summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-16 16:30:28 -0200
committershennetsind <ind@henn.et>2013-11-16 16:30:28 -0200
commit899347ad8a74af01cdeebf24795195cd5a3fdfdc (patch)
treedf53ae694f47a261df35a4a8166f03a6731d46f0
parentaee2f6317e1c927847993801b5973d7e2e27a418 (diff)
parent4943bc87d899cdc42029a841ff609ebeb55ae489 (diff)
downloadhercules-899347ad8a74af01cdeebf24795195cd5a3fdfdc.tar.gz
hercules-899347ad8a74af01cdeebf24795195cd5a3fdfdc.tar.bz2
hercules-899347ad8a74af01cdeebf24795195cd5a3fdfdc.tar.xz
hercules-899347ad8a74af01cdeebf24795195cd5a3fdfdc.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
-rw-r--r--src/map/itemdb.c6
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc12
-rw-r--r--src/plugins/HPMHooking/HPMHooking.HookingPoints.inc3
-rw-r--r--src/plugins/HPMHooking/HPMHooking.Hooks.inc77
-rwxr-xr-xtools/itemdbconverter.pl36
5 files changed, 113 insertions, 21 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 8eb9c0f14..51986fcf6 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -1679,9 +1679,9 @@ int itemdb_readdb_sql_sub(Sql *handle, int n, const char *source) {
SQL->GetData(handle, 19, &data, NULL); id.flag.no_refine = data && atoi(data) ? 0 : 1;
SQL->GetData(handle, 20, &data, NULL); id.look = data ? atoi(data) : 0;
SQL->GetData(handle, 21, &data, NULL); id.flag.bindonequip = data && atoi(data) ? 1 : 0;
- SQL->GetData(handle, 22, &data, NULL); id.script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 23, &data, NULL); id.equip_script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
- SQL->GetData(handle, 24, &data, NULL); id.unequip_script = *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 22, &data, NULL); id.script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 23, &data, NULL); id.equip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
+ SQL->GetData(handle, 24, &data, NULL); id.unequip_script = data && *data ? script->parse(data, source, -id.nameid, SCRIPT_IGNORE_EXTERNAL_BRACKETS) : NULL;
return itemdb->validate_entry(&id, n, source);
}
diff --git a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
index 0f9dd1e9a..b77505fbb 100644
--- a/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HPMHooksCore.inc
@@ -3853,6 +3853,12 @@ struct {
struct HPMHookPoint *HP_pc_scdata_received_post;
struct HPMHookPoint *HP_pc_bound_clear_pre;
struct HPMHookPoint *HP_pc_bound_clear_post;
+ struct HPMHookPoint *HP_pc_expiration_timer_pre;
+ struct HPMHookPoint *HP_pc_expiration_timer_post;
+ struct HPMHookPoint *HP_pc_global_expiration_timer_pre;
+ struct HPMHookPoint *HP_pc_global_expiration_timer_post;
+ struct HPMHookPoint *HP_pc_expire_check_pre;
+ struct HPMHookPoint *HP_pc_expire_check_post;
struct HPMHookPoint *HP_pet_init_pre;
struct HPMHookPoint *HP_pet_init_post;
struct HPMHookPoint *HP_pet_final_pre;
@@ -8806,6 +8812,12 @@ struct {
int HP_pc_scdata_received_post;
int HP_pc_bound_clear_pre;
int HP_pc_bound_clear_post;
+ int HP_pc_expiration_timer_pre;
+ int HP_pc_expiration_timer_post;
+ int HP_pc_global_expiration_timer_pre;
+ int HP_pc_global_expiration_timer_post;
+ int HP_pc_expire_check_pre;
+ int HP_pc_expire_check_post;
int HP_pet_init_pre;
int HP_pet_init_post;
int HP_pet_final_pre;
diff --git a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
index f22ed6b32..57c243913 100644
--- a/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
+++ b/src/plugins/HPMHooking/HPMHooking.HookingPoints.inc
@@ -1957,6 +1957,9 @@ struct HookingPointData HookingPoints[] = {
{ HP_POP(pc->rental_expire, HP_pc_rental_expire) },
{ HP_POP(pc->scdata_received, HP_pc_scdata_received) },
{ HP_POP(pc->bound_clear, HP_pc_bound_clear) },
+ { HP_POP(pc->expiration_timer, HP_pc_expiration_timer) },
+ { HP_POP(pc->global_expiration_timer, HP_pc_global_expiration_timer) },
+ { HP_POP(pc->expire_check, HP_pc_expire_check) },
/* pet */
{ HP_POP(pet->init, HP_pet_init) },
{ HP_POP(pet->final, HP_pet_final) },
diff --git a/src/plugins/HPMHooking/HPMHooking.Hooks.inc b/src/plugins/HPMHooking/HPMHooking.Hooks.inc
index d8b8d65ae..5511959e9 100644
--- a/src/plugins/HPMHooking/HPMHooking.Hooks.inc
+++ b/src/plugins/HPMHooking/HPMHooking.Hooks.inc
@@ -49674,6 +49674,83 @@ void HP_pc_bound_clear(struct map_session_data *sd, enum e_item_bound_type type)
}
return;
}
+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 ) {
+ int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
+ 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 ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ 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++ ) {
+ postHookFunc = HPMHooks.list.HP_pc_expiration_timer_post[hIndex].func;
+ retVal___ = postHookFunc(retVal___, &tid, &tick, &id, &data);
+ }
+ }
+ return retVal___;
+}
+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 ) {
+ int (*preHookFunc) (int *tid, int64 *tick, int *id, intptr_t *data);
+ 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 ) {
+ *HPMforce_return = false;
+ return retVal___;
+ }
+ }
+ {
+ 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++ ) {
+ postHookFunc = HPMHooks.list.HP_pc_global_expiration_timer_post[hIndex].func;
+ 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);
+ for(hIndex = 0; hIndex < HPMHooks.count.HP_pc_expire_check_pre; hIndex++ ) {
+ preHookFunc = HPMHooks.list.HP_pc_expire_check_pre[hIndex].func;
+ preHookFunc(sd);
+ }
+ if( *HPMforce_return ) {
+ *HPMforce_return = false;
+ return;
+ }
+ }
+ {
+ HPMHooks.source.pc.expire_check(sd);
+ }
+ if( HPMHooks.count.HP_pc_expire_check_post ) {
+ void (*postHookFunc) (struct map_session_data *sd);
+ 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;
+}
/* pet */
int HP_pet_init(bool minimal) {
int hIndex = 0;
diff --git a/tools/itemdbconverter.pl b/tools/itemdbconverter.pl
index 54c17262d..13805c09e 100755
--- a/tools/itemdbconverter.pl
+++ b/tools/itemdbconverter.pl
@@ -74,25 +74,25 @@ sub parsedb (@) {
# ID,AegisName,Name,Type,Buy,Sell,Weight,ATK,DEF,Range,Slots,Job,Upper,Gender,Loc,wLV,eLV,Refineable,View,{ Script },{ OnEquip_Script },{ OnUnequip_Script }
if( $_ =~ qr/^
(?<prefix>(?:\/\/[^0-9]*)?)
- (?<ID>[0-9]+),
+ (?<ID>[0-9]+)[^,]*,
(?<AegisName>[^,]+),
- (?<Name>[^,]+),
- (?<Type>[0-9]+),
- (?<Buy>[0-9]*),
- (?<Sell>[0-9]*),
- (?<Weight>[0-9]*),
- (?<ATK>[0-9-]*)(?<hasmatk>:(?<MATK>[0-9-]*))?,
- (?<DEF>[0-9-]*),
- (?<Range>[0-9]*),
- (?<Slots>[0-9]*),
- (?<Job>[x0-9A-Fa-f]*),
- (?<Upper>[0-9]*),
- (?<Gender>[0-9]*),
- (?<Loc>[0-9]*),
- (?<wLV>[0-9]*),
- (?<eLV>[0-9]*)(?<hasmaxlv>:(?<eLVmax>[0-9]*))?,
- (?<Refineable>[0-9]*),
- (?<View>[0-9]*),
+ (?<Name>[^,]+),[\s\t]*
+ (?<Type>[0-9]+)[^,]*,[\s\t]*
+ (?<Buy>[0-9]*)[^,]*,[\s\t]*
+ (?<Sell>[0-9]*)[^,]*,[\s\t]*
+ (?<Weight>[0-9]*)[^,]*,[\s\t]*
+ (?<ATK>[0-9-]*)[^,:]*(?<hasmatk>:[\s\t]*(?<MATK>[0-9-]*))?[^,]*,[\s\t]*
+ (?<DEF>[0-9-]*)[^,]*,[\s\t]*
+ (?<Range>[0-9]*)[^,]*,[\s\t]*
+ (?<Slots>[0-9]*)[^,]*,[\s\t]*
+ (?<Job>[x0-9A-Fa-f]*)[^,]*,[\s\t]*
+ (?<Upper>[0-9]*)[^,]*,[\s\t]*
+ (?<Gender>[0-9]*)[^,]*,[\s\t]*
+ (?<Loc>[0-9]*)[^,]*,[\s\t]*
+ (?<wLV>[0-9]*)[^,]*,[\s\t]*
+ (?<eLV>[0-9]*)[^,:]*(?<hasmaxlv>:[\s\t]*(?<eLVmax>[0-9]*))?[^,]*,[\s\t]*
+ (?<Refineable>[0-9]*)[^,]*,[\s\t]*
+ (?<View>[0-9]*)[^,]*,[\s\t]*
{(?<Script>.*)},
{(?<OnEquip>.*)},
{(?<OnUnequip>.*)}