summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c61
1 files changed, 38 insertions, 23 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;