summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-11-16 18:11:34 -0200
committershennetsind <ind@henn.et>2013-11-16 18:11:34 -0200
commit42a7aa3362807a00f08263d8ead9eb5019051b21 (patch)
treebb911aa4d48566f0b156b0157aa367acbcf175d2 /src
parent899347ad8a74af01cdeebf24795195cd5a3fdfdc (diff)
downloadhercules-42a7aa3362807a00f08263d8ead9eb5019051b21.tar.gz
hercules-42a7aa3362807a00f08263d8ead9eb5019051b21.tar.bz2
hercules-42a7aa3362807a00f08263d8ead9eb5019051b21.tar.xz
hercules-42a7aa3362807a00f08263d8ead9eb5019051b21.zip
Renewal elemental attr fix
I'm committing on malufett's behalf. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c7
-rw-r--r--src/map/pc.c2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 9a70acaca..e1dffb796 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -408,7 +408,10 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
if( t < 5 && atk_elem == t )
damage -= damage * ( tsd->charm[t] * 3 ) / 100;// -3% custom value
}
- return damage*ratio/100;
+ if( ratio < 100 )
+ return damage - (damage * (100 - ratio) / 100);
+ else
+ return damage + (damage * (ratio - 100) / 100);
}
int64 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){ // [malufett]
#ifdef RENEWAL
@@ -846,7 +849,7 @@ int64 battle_calc_elefix(struct block_list *src, struct block_list *target, uint
if( skill_id == MC_CARTREVOLUTION ) //Cart Revolution applies the element fix once more with neutral element
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);
+ damage += battle->attr_fix(src,target,50*skill_lv,ELE_NEUTRAL,tstatus->def_ele, tstatus->ele_lv);
}
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 9cea5d424..b930ffaad 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -10166,8 +10166,10 @@ int pc_readdb(void) {
while(*p==32 && *p>0)
p++;
battle->attr_fix_table[lv-1][i][j]=atoi(p);
+#ifndef RENEWAL
if(battle_config.attr_recover == 0 && battle->attr_fix_table[lv-1][i][j] < 0)
battle->attr_fix_table[lv-1][i][j] = 0;
+#endif
p=strchr(p,',');
if(p) *p++=0;
}