Crown The Empire
-
Content Count
14 -
Joined
-
Last visited
Reputation Activity
-
Crown The Empire reacted to AnnieRuru in New damage formula (Dragon Breath)
if you change skill->attack from BF_MISC into BF_WEAPON,
then you should also change the damage calculation from battle_calc_misc_attack function into battle_calc_weapon_attack function
src/map/battle.c | 15 ++++++++------- src/map/skill.c | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/map/battle.c b/src/map/battle.c index 1b7bf909e..4193c8cd0 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4130,13 +4130,6 @@ static struct Damage battle_calc_misc_attack(struct block_list *src, struct bloc case NPC_EVILLAND: md.damage = skill->calc_heal(src,target,skill_id,skill_lv,false); break; - case RK_DRAGONBREATH: - case RK_DRAGONBREATH_WATER: - md.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv; - RE_LVL_MDMOD(150); - if (sd) md.damage = md.damage * (95 + 5 * pc->checkskill(sd,RK_DRAGONTRAINING)) / 100; - md.flag |= BF_LONG|BF_WEAPON; - break; /** * Ranger **/ @@ -4960,6 +4953,14 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl break; } break; + + case RK_DRAGONBREATH: + case RK_DRAGONBREATH_WATER: + wd.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv; + wd.damage = wd.damage * status->get_lv(src) / 150; + if (sd) wd.damage = wd.damage * (95 + 5 * pc->checkskill(sd,RK_DRAGONTRAINING)) / 100; + wd.flag |= BF_LONG|BF_WEAPON; + break; default: { i = (flag.cri diff --git a/src/map/skill.c b/src/map/skill.c index 633a73d67..4121d66e7 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4937,7 +4937,7 @@ static int skill_castend_damage_id(struct block_list *src, struct block_list *bl if( (tsc = status->get_sc(bl)) && (tsc->data[SC_HIDING] )) { clif->skill_nodamage(src,src,skill_id,skill_lv,1); } else - skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag); + skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); } break; case NPC_SELFDESTRUCTION: { but how you want to change the damage formula is totally up to you ...
-
Crown The Empire reacted to AnnieRuru in New damage formula (Dragon Breath)
@@ -4960,6 +4953,14 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl the patch has clearly said, modify the line somewhere at line no.4960
and your compiler said your error is on line 4127
-
Crown The Empire reacted to AnnieRuru in New damage formula (Dragon Breath)
no idea, I have tested it works
do I seriously have to do like this ?
https://github.com/HerculesWS/Hercules/compare/master...AnnieRuru:topic/16676-n.
https://github.com/AnnieRuru/Hercules/blob/803f7335803460b8a4f2554240a9b29f4686f556/src/map/battle.c#L4957-L4963
-
Crown The Empire got a reaction from banhelba2019 in New damage formula (Dragon Breath)
Old damage formula (before the 175/60 update, implemented December 10, 2014 in iRO):
Damage = [(CurrHP ÷ 50) + (MaxSP ÷ 4)] × (SkillLv × BaseLv ÷ 150) × (95 + DragonTraining_Lv × 5)% New damage formula (after the 175/60 update):
Damage = [(CurrHP ÷ 50) + (MaxSP ÷ 4)] × (SkillLv × BaseLv ÷ 150) × (95 + DragonTraining_Lv × 5)% × (100 + Ranged Damage Modifiers)% x (Elemental Modifiers)% battle.c (Hercules)
case RK_DRAGONBREATH: case RK_DRAGONBREATH_WATER: md.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv; RE_LVL_MDMOD(150); if (sd) md.damage = md.damage * (95 + 5 * pc->checkskill(sd,RK_DRAGONTRAINING)) / 100; md.flag |= BF_LONG|BF_WEAPON; break; battle.ccp (rAthena)
case RK_DRAGONBREATH: case RK_DRAGONBREATH_WATER: { int damagevalue = (sstatus->hp / 50 + status_get_max_sp(src) / 4) * skill_lv; if(status_get_lv(src) > 100) damagevalue = damagevalue * status_get_lv(src) / 150; if(sd) damagevalue = damagevalue * (100 + 5 * (pc_checkskill(sd,RK_DRAGONTRAINING) - 1)) / 100; ATK_ADD(wd->damage, wd->damage2, damagevalue); #ifdef RENEWAL ATK_ADD(wd->weaponAtk, wd->weaponAtk2, damagevalue); #endif wd->flag |= BF_LONG; } skill.c (Hercules)
case RK_DRAGONBREATH_WATER: case RK_DRAGONBREATH: { struct status_change *tsc = NULL; if( (tsc = status->get_sc(bl)) && (tsc->data[SC_HIDING] )) { clif->skill_nodamage(src,src,skill_id,skill_lv,1); } else skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag); } skill.cpp (rAthena)
case RK_DRAGONBREATH_WATER: case RK_DRAGONBREATH: if( tsc && tsc->data[SC_HIDING] ) clif_skill_nodamage(src,src,skill_id,skill_lv,1); else skill_attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); break; So I think the difference is the new formula takes these range, elemental and racial modifiers into account.
It seems this formula was recently implemented in rAthena (BF_WEAPON TYPE), while Hercules is still using the old formula (BF_MISC TYPE). I have tried to merge rathena's new formula into Hercules, but encountered several problems.