summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorhemagx <hemagx2@gmail.com>2015-12-25 19:30:20 +0200
committerhemagx <hemagx2@gmail.com>2015-12-25 19:30:20 +0200
commit75141a35e907f76ce7626f0f7cb421ec3217bcc1 (patch)
treeb511fbe1cebf265a7140db8878bdcc43007d9305 /src/map
parent0fd41008db1c91f2dd62ed2084b4ca4d063c04d9 (diff)
parent654e7629282b1e708e4f08b26b381e6f917b26d3 (diff)
downloadhercules-75141a35e907f76ce7626f0f7cb421ec3217bcc1.tar.gz
hercules-75141a35e907f76ce7626f0f7cb421ec3217bcc1.tar.bz2
hercules-75141a35e907f76ce7626f0f7cb421ec3217bcc1.tar.xz
hercules-75141a35e907f76ce7626f0f7cb421ec3217bcc1.zip
Merge pull request #975 from dastgir/8-RefineDef
Added Costume/Shadow Atk/Def refine bonus setting
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/battle.h3
-rw-r--r--src/map/status.c18
3 files changed, 20 insertions, 4 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 65038f240..1c3817a31 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7192,6 +7192,9 @@ static const struct battle_data {
{ "feature.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, },
+ { "shadow_refine_def", &battle_config.shadow_refine_def, 1, 0, 1, },
+ { "shadow_refine_atk", &battle_config.shadow_refine_atk, 1, 0, 1, },
};
#ifndef STATS_OPT_OUT
/**
diff --git a/src/map/battle.h b/src/map/battle.h
index ad59efedd..586673c17 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -528,6 +528,9 @@ struct Battle_Config {
int show_monster_hp_bar; // [Frost]
int fix_warp_hit_delay_abuse;
+
+ int costume_refine_def, shadow_refine_def;
+ int shadow_refine_atk;
};
/* criteria for battle_config.idletime_critera */
diff --git a/src/map/status.c b/src/map/status.c
index d7a216c97..c7ce2c9c0 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2434,7 +2434,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
sd->status.inventory[index].refine = MAX_REFINE;
if(sd->inventory_data[index]->type == IT_WEAPON) {
- int r,wlv = sd->inventory_data[index]->wlv;
+ int r = sd->status.inventory[index].refine,wlv = sd->inventory_data[index]->wlv;
struct weapon_data *wd;
struct weapon_atk *wa;
if (wlv >= REFINE_TYPE_MAX)
@@ -2447,7 +2447,10 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
wa = &bstatus->rhw;
}
wa->atk += sd->inventory_data[index]->atk;
- if ( (r = sd->status.inventory[index].refine) )
+ if ( !battle_config.shadow_refine_atk && itemdb_is_shadowequip(sd->inventory_data[index]->equip) )
+ r = 0;
+
+ if (r)
wa->atk2 = status->dbs->refine_info[wlv].bonus[r-1] / 100;
#ifdef RENEWAL
@@ -2485,9 +2488,16 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) {
}
}
else if(sd->inventory_data[index]->type == IT_ARMOR) {
- int r;
- if ( (r = sd->status.inventory[index].refine) )
+ int r = sd->status.inventory[index].refine;
+
+ if ( (!battle_config.costume_refine_def && itemdb_is_costumeequip(sd->inventory_data[index]->equip)) ||
+ (!battle_config.shadow_refine_def && itemdb_is_shadowequip(sd->inventory_data[index]->equip))
+ )
+ r = 0;
+
+ if (r)
refinedef += status->dbs->refine_info[REFINE_TYPE_ARMOR].bonus[r-1];
+
if(sd->inventory_data[index]->script) {
if( i == EQI_HAND_L ) //Shield
sd->state.lr_flag = 3;