• 0
Sign in to follow this  
Followers 0
Crown The Empire

New damage formula (Dragon Breath)

Question

Posted (edited)

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.

Edited by Crown The Empire

Share this post


Link to post
Share on other sites

9 answers to this question

  • 0

Posted (edited)

We dont even have oboro/rebel.... Just stay on rathena 

Do you absolutely want this ? 

 

You make a good point actually

 

 

Isnt that what this means ? 

 

        md.flag |= BF_LONG|BF_WEAPON;
BF_LONG = ranged modifiers taken into account 

BF_WEAPON = I guess that would take cards into account 

(and im pretty sure md means meta data, as sd is session data [ so usually this would point to our actual character/stats and hd... homunculus data [ obviously points to homunculus]) Just sayin 

(also if sd.... seems to split the damage formula right? so i think that means that portion of formula wouldnt apply to monsters......... but i would have to test it)

In the skilldb dragonbreath is still going by weapon atk... not misc, just in skill.c not sure why exactly but probably a renewal thing ... ah well it would be misc, and then we raise the flag for BF_WEAPON in battle.c

 

Also im gonna assume since rathena is probably using misc to the ATK_ADD represents the bf_weapon that we use.... not 100% but im not usually wrong

 

Whats your problem ? 

Edited by Orca

Share this post


Link to post
Share on other sites
  • 0

I switched BF MISC on skill.c by BF WEAPON. The damage was very low. In the part of the battle.c also could not do something that worked, can help me to develop something similar to rAthena?

Share this post


Link to post
Share on other sites
  • 0

Posted (edited)

5 hours ago, Crown The Empire said:

I switched BF MISC on skill.c by BF WEAPON. The damage was very low. In the part of the battle.c also could not do something that worked, can help me to develop something similar to rAthena?

Isnt the damage the same ? Do you have both emulators installed ? 

 

In herc battle.c we bring up bf_weapon so theirs no reason to do that(we just use the mdflag so that we can start applying cards)

Quote
  • Defense values are not applied to this skill in the same way as they are applied to other skills. It appears that Hard Defense is subtracted off the final damage value instead of reducing damage by a percent, basically treating it as Soft Defense.

 

This is probably why we leave it as misc on herc, and in rathena they just do it differently but i cant be specific cause I never used this skill in game 

Edited by Orca

Share this post


Link to post
Share on other sites
  • 0

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 ...

Share this post


Link to post
Share on other sites
  • 0
3 hours ago, AnnieRuru said:

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

but how you want to change the damage formula is totally up to you ...

 

I had tried something similar. I compiled and generated these errors.

A1TQyxA.png

Share this post


Link to post
Share on other sites
  • 0
@@ -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

Share this post


Link to post
Share on other sites
  • 0

Posted (edited)

14 minutes ago, AnnieRuru said:
@@ -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

wtf, i'm n00b.

compiled now but the damage continues very low for example I used the skill without weapon and letter = 400 damage

I put 4 cards of elemental damage and the damage was = 450

before all the change the damage was very high without letter or weapon 

Edited by Crown The Empire

Share this post


Link to post
Share on other sites
  • 0

Posted (edited)

1 hour ago, AnnieRuru said:

Sorry for any inconvenience now the skill is being affected by distance damage letters thanks for all the support and patience It worked xd

Edited by Crown The Empire

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0