diff options
author | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-29 20:51:38 +0000 |
---|---|---|
committer | rud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-12-29 20:51:38 +0000 |
commit | 2eec605a3bbdf6ec0292e97692b2ffb8790ab227 (patch) | |
tree | 158e232a33c696d0008b91a0e1fbf0329f531be8 /src | |
parent | 6bd3d89c6e4cda9aba52ec2c6774a2e90f9d47f4 (diff) | |
download | hercules-2eec605a3bbdf6ec0292e97692b2ffb8790ab227.tar.gz hercules-2eec605a3bbdf6ec0292e97692b2ffb8790ab227.tar.bz2 hercules-2eec605a3bbdf6ec0292e97692b2ffb8790ab227.tar.xz hercules-2eec605a3bbdf6ec0292e97692b2ffb8790ab227.zip |
Fixed bugreport:6074 updated Renewal Def and MDef damage reduction formula. Special thanks to KyleZ.
Fixed bugreport:7028 where damage bonus of SR_GATEOFHELL has interchange with normal damage bonus.
Fixed bugreport:6946 where CH_PALMSTRIKE causes damage when caster hides after casting.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@17062 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 61 | ||||
-rw-r--r-- | src/map/pc.c | 6 | ||||
-rw-r--r-- | src/map/pc.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 4 |
4 files changed, 47 insertions, 25 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 9fb46bfff..aab2ad3eb 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2981,9 +2981,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo case SR_GATEOFHELL: ATK_ADD (sstatus->max_hp - status_get_hp(src)); if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE){ - ATK_ADD ( ((int64)sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src) ); - }else{ ATK_ADD ( ((int64)sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) ); + }else{ + ATK_ADD ( ((int64)sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src) ); } break; case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target Base Level x 40) @@ -3173,47 +3173,64 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo } //Vitality reduction from rodatazone: http://rodatazone.simgaming.net/mechanics/substats.php#def if (tsd) //Sd vit-eq - { //[VIT*0.5] + rnd([VIT*0.3], max([VIT*0.3],[VIT^2/150]-1)) + { +#ifndef RENEWAL + //[VIT*0.5] + rnd([VIT*0.3], max([VIT*0.3],[VIT^2/150]-1)) vit_def = def2*(def2-15)/150; vit_def = def2/2 + (vit_def>0?rnd()%vit_def:0); - +#else + vit_def = def2; +#endif if((battle_check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesnt work vs players src->type == BL_MOB && (skill=pc_checkskill(tsd,AL_DP)) > 0) vit_def += skill*(int)(3 +(tsd->status.base_level+1)*0.04); // submitted by orn if( src->type == BL_MOB && (skill=pc_checkskill(tsd,RA_RANGERMAIN))>0 && (sstatus->race == RC_BRUTE || sstatus->race == RC_FISH || sstatus->race == RC_PLANT) ) vit_def += skill*5; - } else { //Mob-Pet vit-eq + } + else { //Mob-Pet vit-eq +#ifndef RENEWAL //VIT + rnd(0,[VIT/20]^2-1) vit_def = (def2/20)*(def2/20); vit_def = def2 + (vit_def>0?rnd()%vit_def:0); +#else + vit_def = def2; +#endif } + if (battle_config.weapon_defense_type) { vit_def += def1*battle_config.weapon_defense_type; def1 = 0; } #ifdef RENEWAL - /** - * In Renewal 100% damage reduction is 900 DEF - * Formula: (1+(900-def1)/9)% - **/ - if (def1 > 900) def1 = 900; - ATK_RATE2( - flag.idef ?100:(flag.pdef ? (flag.pdef*(def1+vit_def)) : (1+(900-def1)/9)), - flag.idef2?100:(flag.pdef2 ? (flag.pdef2*(def1+vit_def)) : (1+(900-def1)/9)) - ); + /** + * RE DEF Reduction + * Damage = Attack * (4000+eDEF)/(4000+eDEF) - sDEF + * Icepick no longer bypasses defense, but gains 1 atk per def + **/ + + ATK_ADD2( + flag.pdef ?(def1+vit_def):0, + flag.pdef2?(def1+vit_def):0 + ); + if (!flag.idef || !flag.idef2){ + wd.damage = wd.damage * (4000+def1) / (4000+10*def1) - vit_def; + if(flag.lh) + wd.damage2 = wd.damage2 * (4000+def1) / (4000+10*def1) - vit_def; + } + #else if (def1 > 100) def1 = 100; ATK_RATE2( flag.idef ?100:(flag.pdef ? (flag.pdef*(def1+vit_def)) : (100-def1)), flag.idef2?100:(flag.pdef2? (flag.pdef2*(def1+vit_def)) : (100-def1)) ); + ATK_ADD2( + flag.idef ||flag.pdef ?0:-vit_def, + flag.idef2||flag.pdef2?0:-vit_def + ); #endif - ATK_ADD2( - flag.idef ||flag.pdef ?0:-vit_def, - flag.idef2||flag.pdef2?0:-vit_def - ); } //Post skill/vit reduction damage increases @@ -4055,12 +4072,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list } #ifdef RENEWAL /** - * RE MDEF Reduction (from doddler:?title=Renewal_Changes#MDEF) - * Damage from magic = Magic Attack * 111.5/(111.5+eMDEF) - * Damage = Magic Attack * 111.5/(111.5+eMDEF) - sMDEF + * RE MDEF Reduction + * Damage = Magic Attack * (1000+eMDEF)/(1000+eMDEF) - sMDEF **/ - if(mdef < -111) mdef = -111; // value smaller -111 brings back the damage to origin up to -223. - ad.damage = ad.damage * 1115 / (1115 + mdef * 10) - mdef2; + ad.damage = ad.damage * (1000 + mdef) / (1000 + mdef * 10) - mdef2; #else if(battle_config.magic_defense_type) ad.damage = ad.damage - mdef*battle_config.magic_defense_type - mdef2; diff --git a/src/map/pc.c b/src/map/pc.c index 1f7697b0d..c7c9d7114 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2057,8 +2057,12 @@ int pc_bonus(struct map_session_data *sd,int type,int val) break; case SP_BASE_ATK: if(sd->state.lr_flag != 2) { +//#ifdef RENEWAL +// sd->bonus.eatk += val; +//#else bonus = status->batk + val; status->batk = cap_value(bonus, 0, USHRT_MAX); +//#endif } break; case SP_DEF1: @@ -2592,7 +2596,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) if(sd->state.lr_flag != 2) sd->bonus.itemhealrate2 += val; break; - case SP_EMATK: + case SP_EMATK: if(sd->state.lr_flag != 2) sd->bonus.ematk += val; break; diff --git a/src/map/pc.h b/src/map/pc.h index 9b7a3b964..e04602b99 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -320,6 +320,7 @@ struct map_session_data { unsigned short unstripable_equip; int fixcastrate,varcastrate; int ematk; // matk bonus from equipment +// int eatk; // atk bonus from equipment } bonus; // zeroed vars end here. diff --git a/src/map/skill.c b/src/map/skill.c index e2dc2c03b..ece45ce92 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -3282,7 +3282,9 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data) case CH_PALMSTRIKE: { struct status_change* tsc = status_get_sc(target); - if( tsc && tsc->option&OPTION_HIDE ){ + struct status_change* sc = status_get_sc(src); + if( tsc && tsc->option&OPTION_HIDE || + sc && sc->option&OPTION_HIDE ){ skill_blown(src,target,skill_get_blewcount(skl->skill_id, skl->skill_lv), -1, 0x0 ); break; } |