From 42a7aa3362807a00f08263d8ead9eb5019051b21 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 16 Nov 2013 18:11:34 -0200 Subject: Renewal elemental attr fix I'm committing on malufett's behalf. Signed-off-by: shennetsind --- src/map/battle.c | 7 +++++-- src/map/pc.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3-60-g2f50