From 50de773053b9c1849381d0502021898782b5994a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Apr 2015 01:43:04 +0300 Subject: Allow for plugins read custom fields from jobdb1. --- src/map/status.c | 267 ++++++++++++++++++++++++++++--------------------------- src/map/status.h | 3 +- 2 files changed, 140 insertions(+), 130 deletions(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 91ab19558..2f514787d 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -12052,18 +12052,11 @@ int status_get_sc_type(sc_type type) { return status->sc_conf[type]; } -/*------------------------------------------ -* DB reading. -* job_db1.txt - weight, hp, sp, aspd -* job_db2.txt - job level stat bonuses -* size_fix.txt - size adjustment table for weapons -* refine_db.txt - refining data table -*------------------------------------------*/ -void status_read_job_db(void) { /* [malufett/Hercules] */ - int i = 0; - config_t job_db_conf; - config_setting_t *jdb = NULL; - const char *config_filename = "db/"DBPATH"job_db.conf"; +void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) +{ + config_setting_t *temp = NULL; + int i32 = 0; + struct { const char *name; int id; @@ -12097,139 +12090,154 @@ void status_read_job_db(void) { /* [malufett/Hercules] */ #endif }; - if ( libconfig->read_file(&job_db_conf, config_filename) ) { - ShowError("can't read %s\n", config_filename); - return; - } - while ( (jdb = libconfig->setting_get_elem(job_db_conf.root, i++)) ) { - int class_, idx, i32 = 0; - config_setting_t *temp = NULL; - const char *name = config_setting_name(jdb); - - if ( (class_ = pc->check_job_name(name)) == -1 ) { - ShowWarning("pc_read_job_db: '%s' unknown job name!\n", name); - continue; - } - - idx = pc->class2idx(class_); - if ( (temp = libconfig->setting_get_member(jdb, "Inherit")) ) { - int nidx = 0, iidx, w; - const char *iname; - while ( (iname = libconfig->setting_get_string_elem(temp, nidx++)) ) { - int iclass, ave, total = 0; - if ( (iclass = pc->check_job_name(iname)) == -1 ) { - ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s'!\n", name, iname); - continue; - } - iidx = pc->class2idx(iclass); - status->max_weight_base[idx] = status->max_weight_base[iidx]; - memcpy(&status->aspd_base[idx], &status->aspd_base[iidx], sizeof(status->aspd_base[iidx])); - for ( w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++ ) { - status->HP_table[idx][w] = status->HP_table[iidx][w]; - total += status->HP_table[idx][w]; - } - ave = total / (w - 1); - for ( ; w <= pc->max_level[idx][0]; w++ ) { - status->HP_table[idx][w] = min(ave * w, battle_config.max_hp); - } - for ( w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++ ) { - status->SP_table[idx][w] = status->SP_table[iidx][w]; - total += status->SP_table[idx][w]; - } - ave = total / (w - 1); - for ( ; w <= pc->max_level[idx][0]; w++ ) { - status->SP_table[idx][w] = min(ave * w, battle_config.max_sp); - } + if ((temp = libconfig->setting_get_member(jdb, "Inherit"))) { + int nidx = 0, iidx, w; + const char *iname; + while ((iname = libconfig->setting_get_string_elem(temp, nidx++))) { + int iclass, ave, total = 0; + if ((iclass = pc->check_job_name(iname)) == -1) { + ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s'!\n", name, iname); + continue; + } + iidx = pc->class2idx(iclass); + status->max_weight_base[idx] = status->max_weight_base[iidx]; + memcpy(&status->aspd_base[idx], &status->aspd_base[iidx], sizeof(status->aspd_base[iidx])); + for (w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++) { + status->HP_table[idx][w] = status->HP_table[iidx][w]; + total += status->HP_table[idx][w]; + } + ave = total / (w - 1); + for ( ; w <= pc->max_level[idx][0]; w++) { + status->HP_table[idx][w] = min(ave * w, battle_config.max_hp); + } + for (w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++) { + status->SP_table[idx][w] = status->SP_table[iidx][w]; + total += status->SP_table[idx][w]; + } + ave = total / (w - 1); + for ( ; w <= pc->max_level[idx][0]; w++) { + status->SP_table[idx][w] = min(ave * w, battle_config.max_sp); } } - if ( (temp = libconfig->setting_get_member(jdb, "InheritHP")) ) { - int nidx = 0, iidx; - const char *iname; - while ( (iname = libconfig->setting_get_string_elem(temp, nidx++)) ) { - int iclass, w, ave, total = 0; - if ( (iclass = pc->check_job_name(iname)) == -1 ) { - ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s' HP!\n", name, iname); - continue; - } - iidx = pc->class2idx(iclass); - for ( w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++ ) { - status->HP_table[idx][w] = status->HP_table[iidx][w]; - total += status->HP_table[idx][w]; - } - ave = total / (w - 1); - for ( ; w <= pc->max_level[idx][0]; w++ ) { - status->HP_table[idx][w] = min(ave * w, battle_config.max_hp); - } + } + if ((temp = libconfig->setting_get_member(jdb, "InheritHP"))) { + int nidx = 0, iidx; + const char *iname; + while ((iname = libconfig->setting_get_string_elem(temp, nidx++))) { + int iclass, w, ave, total = 0; + if ((iclass = pc->check_job_name(iname)) == -1) { + ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s' HP!\n", name, iname); + continue; + } + iidx = pc->class2idx(iclass); + for (w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++) { + status->HP_table[idx][w] = status->HP_table[iidx][w]; + total += status->HP_table[idx][w]; + } + ave = total / (w - 1); + for ( ; w <= pc->max_level[idx][0]; w++ ) { + status->HP_table[idx][w] = min(ave * w, battle_config.max_hp); } } - if ( (temp = libconfig->setting_get_member(jdb, "InheritSP")) ) { - int nidx = 0, iidx, ave, total = 0; - const char *iname; - while ( (iname = libconfig->setting_get_string_elem(temp, nidx++)) ) { - int iclass, w; - if ( (iclass = pc->check_job_name(iname)) == -1 ) { - ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s' SP!\n", name, iname); - continue; - } - iidx = pc->class2idx(iclass); - for ( w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++ ) { - status->SP_table[idx][w] = status->SP_table[iidx][w]; - total += status->SP_table[idx][w]; - } - ave = total / (w - 1); - for ( ; w <= pc->max_level[idx][0]; w++ ) { - status->SP_table[idx][w] = min(ave * w, battle_config.max_sp); - } + } + if ((temp = libconfig->setting_get_member(jdb, "InheritSP"))) { + int nidx = 0, iidx, ave, total = 0; + const char *iname; + while ((iname = libconfig->setting_get_string_elem(temp, nidx++))) { + int iclass, w; + if ((iclass = pc->check_job_name(iname)) == -1) { + ShowWarning("status_read_job_db: '%s' trying to inherit unknown '%s' SP!\n", name, iname); + continue; + } + iidx = pc->class2idx(iclass); + for (w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++) { + status->SP_table[idx][w] = status->SP_table[iidx][w]; + total += status->SP_table[idx][w]; + } + ave = total / (w - 1); + for ( ; w <= pc->max_level[idx][0]; w++) { + status->SP_table[idx][w] = min(ave * w, battle_config.max_sp); } } + } - if ( libconfig->setting_lookup_int(jdb, "Weight", &i32) ) - status->max_weight_base[idx] = i32; - else if ( !status->max_weight_base[idx] ) - status->max_weight_base[idx] = 20000; + if (libconfig->setting_lookup_int(jdb, "Weight", &i32)) + status->max_weight_base[idx] = i32; + else if (!status->max_weight_base[idx]) + status->max_weight_base[idx] = 20000; - if ( (temp = libconfig->setting_get_member(jdb, "BaseASPD")) ) { - int widx = 0; - 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); + if ((temp = libconfig->setting_get_member(jdb, "BaseASPD"))) { + int widx = 0; + 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); - ARR_FIND(0, wlen, w, strcmp(wnames[w].name, wname) == 0); - if ( w != wlen ) { - status->aspd_base[idx][wnames[w].id] = libconfig->setting_get_int(wpn); - } else { - ShowWarning("status_read_job_db: unknown weapon type '%s'!\n", wname); - } + ARR_FIND(0, wlen, w, strcmp(wnames[w].name, wname) == 0); + if (w != wlen) { + status->aspd_base[idx][wnames[w].id] = libconfig->setting_get_int(wpn); + } else { + ShowWarning("status_read_job_db: unknown weapon type '%s'!\n", wname); } } + } - if ( (temp = libconfig->setting_get_member(jdb, "HPTable")) ) { - int level = 0, ave, total = 0; - config_setting_t *hp = NULL; - while ( (hp = libconfig->setting_get_elem(temp, level++)) ) { - status->HP_table[idx][level] = i32 = min(libconfig->setting_get_int(hp), battle_config.max_hp); - total += i32 - status->HP_table[idx][level - 1]; - } - ave = total / (level - 1); - for ( ; level <= pc->max_level[idx][0]; level++ ) { /* limit only to possible maximum level of the given class */ - status->HP_table[idx][level] = min(ave * level, battle_config.max_hp); /* some are still empty? then let's use the average increase */ - } + if ((temp = libconfig->setting_get_member(jdb, "HPTable"))) { + int level = 0, ave, total = 0; + config_setting_t *hp = NULL; + while ((hp = libconfig->setting_get_elem(temp, level++))) { + status->HP_table[idx][level] = i32 = min(libconfig->setting_get_int(hp), battle_config.max_hp); + total += i32 - status->HP_table[idx][level - 1]; + } + ave = total / (level - 1); + for ( ; level <= pc->max_level[idx][0]; level++ ) { /* limit only to possible maximum level of the given class */ + status->HP_table[idx][level] = min(ave * level, battle_config.max_hp); /* some are still empty? then let's use the average increase */ } + } - if ( (temp = libconfig->setting_get_member(jdb, "SPTable")) ) { - int level = 0, ave, total = 0; - config_setting_t *sp = NULL; - while ( (sp = libconfig->setting_get_elem(temp, level++)) ) { - status->SP_table[idx][level] = i32 = min(libconfig->setting_get_int(sp), battle_config.max_sp); - total += i32 - status->SP_table[idx][level - 1]; - } - ave = total / (level - 1); - for ( ; level <= pc->max_level[idx][0]; level++ ) { - status->SP_table[idx][level] = min(ave * level, battle_config.max_sp); - } + if ((temp = libconfig->setting_get_member(jdb, "SPTable"))) { + int level = 0, ave, total = 0; + config_setting_t *sp = NULL; + while ((sp = libconfig->setting_get_elem(temp, level++))) { + status->SP_table[idx][level] = i32 = min(libconfig->setting_get_int(sp), battle_config.max_sp); + total += i32 - status->SP_table[idx][level - 1]; + } + ave = total / (level - 1); + for ( ; level <= pc->max_level[idx][0]; level++ ) { + status->SP_table[idx][level] = min(ave * level, battle_config.max_sp); } } +} + +/*------------------------------------------ +* DB reading. +* job_db1.txt - weight, hp, sp, aspd +* job_db2.txt - job level stat bonuses +* size_fix.txt - size adjustment table for weapons +* refine_db.txt - refining data table +*------------------------------------------*/ +void status_read_job_db(void) { /* [malufett/Hercules] */ + int i = 0; + config_t job_db_conf; + config_setting_t *jdb = NULL; + const char *config_filename = "db/"DBPATH"job_db.conf"; + + if ( libconfig->read_file(&job_db_conf, config_filename) ) { + ShowError("can't read %s\n", config_filename); + return; + } + while ( (jdb = libconfig->setting_get_elem(job_db_conf.root, i++)) ) { + int class_, idx; + const char *name = config_setting_name(jdb); + + if ( (class_ = pc->check_job_name(name)) == -1 ) { + ShowWarning("pc_read_job_db: '%s' unknown job name!\n", name); + continue; + } + + idx = pc->class2idx(class_); + status->read_job_db_sub(idx, name, jdb); + } libconfig->destroy(&job_db_conf); } @@ -12547,4 +12555,5 @@ void status_defaults(void) { status->readdb_refine = status_readdb_refine; status->readdb_scconfig = status_readdb_scconfig; status->read_job_db = status_read_job_db; + status->read_job_db_sub = status_read_job_db_sub; } diff --git a/src/map/status.h b/src/map/status.h index 98d5d415c..c8a7a08f7 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -6,7 +6,7 @@ #define MAP_STATUS_H #include "../config/core.h" // defType, RENEWAL, RENEWAL_ASPD - +#include "../common/conf.h" #include "../common/cbasetypes.h" #include "../common/mmo.h" // NEW_CARTS @@ -2116,6 +2116,7 @@ struct status_interface { bool (*readdb_refine) (char *fields[], int columns, int current); 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); }; struct status_interface *status; -- cgit v1.2.3-70-g09d2 From 47c691f0e703af91702105a3a877fb8071fc0f1d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 12 Apr 2015 01:55:48 +0300 Subject: In comment change job_db1.txt to job_db.conf --- src/map/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 2f514787d..4c6542846 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -12211,7 +12211,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) /*------------------------------------------ * DB reading. -* job_db1.txt - weight, hp, sp, aspd +* job_db.conf - weight, hp, sp, aspd * job_db2.txt - job level stat bonuses * size_fix.txt - size adjustment table for weapons * refine_db.txt - refining data table -- cgit v1.2.3-70-g09d2 From dda4f86ce41e63011a1f6ef858b093ce388c912d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 16 Apr 2015 00:41:01 +0300 Subject: Update HPM hooks. --- .../HPMHooking/HPMHooking_map.HPMHooksCore.inc | 4 ++++ .../HPMHooking/HPMHooking_map.HookingPoints.inc | 1 + src/plugins/HPMHooking/HPMHooking_map.Hooks.inc | 26 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc index d7a6cf672..7ae80e07c 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc @@ -5053,6 +5053,8 @@ struct { struct HPMHookPoint *HP_status_readdb_scconfig_post; struct HPMHookPoint *HP_status_read_job_db_pre; 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_storage_reconnect_pre; struct HPMHookPoint *HP_storage_reconnect_post; struct HPMHookPoint *HP_storage_delitem_pre; @@ -10260,6 +10262,8 @@ struct { int HP_status_readdb_scconfig_post; int HP_status_read_job_db_pre; 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_storage_reconnect_pre; int HP_storage_reconnect_post; int HP_storage_delitem_pre; diff --git a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc index 05ceb4ab1..ac34c8d07 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.HookingPoints.inc @@ -2564,6 +2564,7 @@ struct HookingPointData HookingPoints[] = { { HP_POP(status->readdb_refine, HP_status_readdb_refine) }, { 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(storage->reconnect, HP_storage_reconnect) }, { HP_POP(storage->delitem, HP_storage_delitem) }, diff --git a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc index 8f7c4f0b4..42e6a574d 100644 --- a/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc +++ b/src/plugins/HPMHooking/HPMHooking_map.Hooks.inc @@ -67963,6 +67963,32 @@ void HP_status_read_job_db(void) { } return; } +void HP_status_read_job_db_sub(int idx, const char *name, 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); + *HPMforce_return = false; + 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); + } + if( *HPMforce_return ) { + *HPMforce_return = false; + return; + } + } + { + 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++ ) { + postHookFunc = HPMHooks.list.HP_status_read_job_db_sub_post[hIndex].func; + postHookFunc(&idx, name, jdb); + } + } + return; +} /* storage */ void HP_storage_reconnect(void) { int hIndex = 0; -- cgit v1.2.3-70-g09d2 From 0f2b317372c2d1c95d4f09c94d054958418a39b4 Mon Sep 17 00:00:00 2001 From: malufett Date: Sun, 19 Apr 2015 22:26:47 +0800 Subject: Fixed Bug#8636 -http://hercules.ws/board/tracker/issue-8636-unknown-weapon-type/?gopid=25011#entry25011 Signed-off-by: malufett --- src/map/status.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 4c6542846..2ccaca1dc 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -12220,7 +12220,12 @@ void status_read_job_db(void) { /* [malufett/Hercules] */ int i = 0; config_t job_db_conf; config_setting_t *jdb = NULL; - const char *config_filename = "db/"DBPATH"job_db.conf"; + const char *config_filename = +#ifdef RENEWAL_ASPD + "db/re/job_db.conf"; +#else + "db/pre/job_db.conf"; +#endif if ( libconfig->read_file(&job_db_conf, config_filename) ) { ShowError("can't read %s\n", config_filename); -- cgit v1.2.3-70-g09d2 From 443c1d02e7351aa9e9ac8ddf0e7781dadc2b7d70 Mon Sep 17 00:00:00 2001 From: Taylor Locke Date: Sun, 19 Apr 2015 11:48:15 -0700 Subject: Fixed wrong job_db.conf path from 0f2b317372c2d1c95d4f09c94d054958418a39b4. --- src/map/status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 2ccaca1dc..9977332df 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -12224,7 +12224,7 @@ void status_read_job_db(void) { /* [malufett/Hercules] */ #ifdef RENEWAL_ASPD "db/re/job_db.conf"; #else - "db/pre/job_db.conf"; + "db/pre-re/job_db.conf"; #endif if ( libconfig->read_file(&job_db_conf, config_filename) ) { -- cgit v1.2.3-70-g09d2 From 59b18ffcf7c834c78e1112337983d86e3649709f Mon Sep 17 00:00:00 2001 From: malufett Date: Mon, 20 Apr 2015 23:03:38 +0800 Subject: Fixed Bug#8638 -http://hercules.ws/board/tracker/issue-8638-sp/?gopid=25021#entry25021 Signed-off-by: malufett --- src/map/status.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/status.c b/src/map/status.c index 9977332df..0b406850e 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -12104,7 +12104,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) memcpy(&status->aspd_base[idx], &status->aspd_base[iidx], sizeof(status->aspd_base[iidx])); for (w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++) { status->HP_table[idx][w] = status->HP_table[iidx][w]; - total += status->HP_table[idx][w]; + total += status->HP_table[idx][w] - status->HP_table[idx][w - 1]; } ave = total / (w - 1); for ( ; w <= pc->max_level[idx][0]; w++) { @@ -12112,7 +12112,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) } for (w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++) { status->SP_table[idx][w] = status->SP_table[iidx][w]; - total += status->SP_table[idx][w]; + total += status->SP_table[idx][w] - status->SP_table[idx][w - 1]; } ave = total / (w - 1); for ( ; w <= pc->max_level[idx][0]; w++) { @@ -12132,7 +12132,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) iidx = pc->class2idx(iclass); for (w = 1; w <= MAX_LEVEL && status->HP_table[iidx][w]; w++) { status->HP_table[idx][w] = status->HP_table[iidx][w]; - total += status->HP_table[idx][w]; + total += status->HP_table[idx][w] - status->HP_table[idx][w - 1]; } ave = total / (w - 1); for ( ; w <= pc->max_level[idx][0]; w++ ) { @@ -12152,7 +12152,7 @@ void status_read_job_db_sub(int idx, const char *name, config_setting_t *jdb) iidx = pc->class2idx(iclass); for (w = 1; w <= MAX_LEVEL && status->SP_table[iidx][w]; w++) { status->SP_table[idx][w] = status->SP_table[iidx][w]; - total += status->SP_table[idx][w]; + total += status->SP_table[idx][w] - status->SP_table[idx][w-1]; } ave = total / (w - 1); for ( ; w <= pc->max_level[idx][0]; w++) { @@ -12243,6 +12243,7 @@ void status_read_job_db(void) { /* [malufett/Hercules] */ 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); libconfig->destroy(&job_db_conf); } -- cgit v1.2.3-70-g09d2 From 4f91161c116359069943aa2604551ca1b64eaa47 Mon Sep 17 00:00:00 2001 From: malufett Date: Thu, 23 Apr 2015 04:47:31 +0800 Subject: Fixed Bug#8474 -http://hercules.ws/board/tracker/issue-8474-elemental-damage-amplifier-doesnt-apply-to-cart-cannon/ Signed-off-by: malufett --- src/map/battle.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 539d3516e..31b04ad44 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -427,7 +427,7 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u else damage = battle->calc_sizefix(sd, damage, EQI_HAND_L, size, flag & 8); - if ( flag & 2 && sd->bonus.arrow_atk ) + if ( flag & 2 && sd->bonus.arrow_atk && skill_id != GN_CARTCANNON ) damage += sd->bonus.arrow_atk; if ( sd->battle_status.equip_atk != 0 ) @@ -886,8 +886,6 @@ int64 battle_calc_elefix(struct block_list *src, struct block_list *target, uint damage = battle->attr_fix(src,target,damage,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); if( skill_id == NC_ARMSCANNON ) damage = battle->attr_fix(src,target,damage,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); - if( skill_id == GN_CARTCANNON ) - damage = battle->attr_fix(src,target,damage,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); if( skill_id == GS_GROUNDDRIFT ) //Additional 50*lv Neutral damage. damage += battle->attr_fix(src,target,50*skill_lv,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv); } @@ -2541,7 +2539,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block } break; case GN_CARTCANNON: - skillratio = 50 * (sd ? pc->checkskill(sd, GN_REMODELING_CART) : 5) * (st->int_ / 40) + 60 * skill_lv; + skillratio += -100 + (int)(50.0f * (sd ? pc->checkskill(sd, GN_REMODELING_CART) : 5) * (st->int_ / 40.0f) + 60.0f * skill_lv); break; case GN_SPORE_EXPLOSION: skillratio = 100 * skill_lv + (200 + st->int_) * status->get_lv(src) / 100; @@ -4352,6 +4350,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list case PA_SACRIFICE: flag.distinct = 1; break; + case GN_CARTCANNON: case PA_SHIELDCHAIN: case GS_MAGICALBULLET: case NJ_SYURIKEN: @@ -4928,6 +4927,14 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list wd.damage = max(wd.damage, 1); } break; + case GN_CARTCANNON: + GET_NORMAL_ATTACK((sc && sc->data[SC_MAXIMIZEPOWER] ? 1 : 0) | (sc && sc->data[SC_WEAPONPERFECT] ? 8 : 0), skill_id); + ATK_ADD(sd ? sd->bonus.arrow_atk : 0); + wd.damage = battle->calc_masteryfix(src, target, skill_id, skill_lv, wd.damage, wd.div_, 0, flag.weapon); + ATK_RATE(battle->calc_skillratio(BF_WEAPON, src, target, skill_id, skill_lv, skillratio, wflag)); + if ( sd && s_ele != sd->bonus.arrow_ele ) + s_ele = sd->bonus.arrow_ele; + break; case NJ_TATAMIGAESHI: ATK_RATE(200); /* Fall through */ @@ -5208,7 +5215,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list //Div fix. damage_div_fix(wd.damage, wd.div_); if ( skill_id > 0 && (skill->get_ele(skill_id, skill_lv) == ELE_NEUTRAL || flag.distinct) ) { // re-evaluate forced neutral skills - wd.damage = battle->attr_fix(src, target, wd.damage, s_ele_, tstatus->def_ele, tstatus->ele_lv); + wd.damage = battle->attr_fix(src, target, wd.damage, s_ele, tstatus->def_ele, tstatus->ele_lv); if ( flag.lh ) wd.damage2 = battle->attr_fix(src, target, wd.damage2, s_ele_, tstatus->def_ele, tstatus->ele_lv); } -- cgit v1.2.3-70-g09d2 From 2dce430b26c9cc4a4c7cabf9bbd6fa4dd0d7b360 Mon Sep 17 00:00:00 2001 From: malufett Date: Thu, 23 Apr 2015 05:04:41 +0800 Subject: Fixed Bug#8644 -http://hercules.ws/board/tracker/issue-8644-cr-fullprotection/ Signed-off-by: malufett --- src/map/skill.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/map/skill.c b/src/map/skill.c index 4c8ecb40f..a9737f129 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -7649,6 +7649,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin map->freeblock_unlock(); // Don't consume item requirements return 0; } + clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); } break; -- cgit v1.2.3-70-g09d2