Hi,
I have figured out that Final Strike isn't influenced by MaxHP.
How can I change it to the official formula?
I am using (one of) the latest rAthena rev. and set it to pre-renewal.
My src/map/battle.c says this:
#ifdef RENEWAL
case LK_SPIRALPIERCE:
case ML_SPIRALPIERCE:
if (sd) {
short index = sd->equip_index[EQI_HAND_R];
if (index >= 0 &&
sd->inventory_data[index] &&
sd->inventory_data[index]->type == IT_WEAPON)
wd.equipAtk += sd->inventory_data[index]->weight/20; // weight from spear is treated as equipment ATK on official [helvetica]
wd = battle_calc_damage_parts(wd, src, target, skill_id, skill_lv);
wd.masteryAtk = 0; // weapon mastery is ignored for spiral
} else {
wd.damage = battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, 0); //Monsters have no weight and use ATK instead
}
switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection?
case SZ_SMALL: //Small: 125%
ATK_RATE(wd.damage, wd.damage2, 125);
RE_ALLATK_RATE(wd, 125);
break;
//case SZ_MEDIUM: //Medium: 100%
case SZ_BIG: //Large: 75%
ATK_RATE(wd.damage, wd.damage2, 75);
RE_ALLATK_RATE(wd, 75);
break;
}
#else
case NJ_ISSEN:
wd.damage = 40 * sstatus->str + (8 / 100) * skill_lv * sstatus->hp;
wd.damage2 = 0;
break;
case LK_SPIRALPIERCE:
case ML_SPIRALPIERCE:
if (sd) {
short index = sd->equip_index[EQI_HAND_R];
if (index >= 0 &&
sd->inventory_data[index] &&
sd->inventory_data[index]->type == IT_WEAPON)
wd.damage = sd->inventory_data[index]->weight*8/100; //80% of weight
ATK_ADDRATE(wd.damage, wd.damage2, 50*skill_lv); //Skill modifier applies to weight only.
} else {
wd.damage = battle_calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, sd, 0); //Monsters have no weight and use ATK instead
}
i = sstatus->str/10;
i*=i;
ATK_ADD(wd.damage, wd.damage2, i); //Add str bonus.
switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection?
case SZ_SMALL: //Small: 125%
ATK_RATE(wd.damage, wd.damage2, 125);
break;
//case SZ_MEDIUM: //Medium: 100%
case SZ_BIG: //Large: 75%
ATK_RATE(wd.damage, wd.damage2, 75);
break;
}
#ifdef RENEWAL
case NJ_ISSEN:
// Official Renewal formula [helvetica]
// base damage = currenthp + ((atk * currenthp * skill level) / maxhp)
// final damage = base damage + ((mirror image count + 1) / 5 * base damage) - (edef + sdef)
// modified def formula
{
short totaldef;
struct Damage atk = battle_calc_weapon_attack(src, target, skill_id, skill_lv, 0);
struct status_change *sc = status_get_sc(src);
md.damage = (int64)sstatus->hp + (atk.damage * (int64)sstatus->hp * skill_lv) / (int64)sstatus->max_hp;
if (sc && sc->data[SC_BUNSINJYUTSU] && (i=sc->data[SC_BUNSINJYUTSU]->val2) > 0) { // mirror image bonus only occurs if active
md.div_ = -( i + 2 ); // mirror image count + 2
md.damage += (md.damage * (((i + 1) * 10) / 5)) / 10;
}
// modified def reduction, final damage = base damage - (edef + sdef)
totaldef = tstatus->def2 + (short)status_get_def(target);
md.damage -= totaldef;
}
break;
#ifdef RENEWAL
break;
case NJ_ISSEN: // Final Strike will MISS on "plant"-type mobs [helvetica]
md.damage = 0;
md.dmg_lv=ATK_FLEE;
break;
What do I need to change to get the official damage formula?
Thanks!