Jump to content
  • 0
Sign in to follow this  
newbieppl

New Formula for Dragon Breath

Question

As you may know, iRO implemented the new dragon breath formula, which is stated in the iro wiki as:

 

 

Damage = [(CurrHP ÷ 50) + (MaxSP ÷ 4)] × (SkillLv × BaseLv ÷ 150) × (95 + DragonTraining_Lv × 5)% × (100 + Ranged Damage Modifers)% x (Elemental Modifiers)% x (100 + Racial Modifiers)%

 

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.

 

The changes I have made in code are:

"/src/map/skill.c" ​, changed BF_MISC to BF_WEAPON


		/**		 * Rune Knight		 **/		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_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);		}

 

"/src/map/battle.c", delete the original formula in misc type, add the new formula in weapon type

old:

struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int mflag) {...	    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;...}

new:

struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int wflag){...			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(damagevalue);				wd.flag |= BF_LONG;			}			break;...}

I have also changed the nk (skill type?) of dragonbreath in skill_db to 0x62, thus the skill ignores target's DEF and has no miss.

 

 

However, after these changes, the dragon breath seems neutral attack (in skill_db it is still set as fire, or water for the breath water), there is no elemental fix involved in the damage.

 

It would be greatly appreciated if someone could help me to add the elemental modifier, or pointed out where I have missed for merging this new formula.

 

 

 

Edited by newbieppl

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

It actually isn't supposed to ignore DEF now either and only benefits from ranged damage % effects, not racial or elemental cards.
 
You're placing the formula in the wrong block, and without battle->calc_cardfix2 it's going to ignore reductions.
 
 
In battle.c, move to where CR_SHIELDBOOMERANG formula is (line 4769) and place this below:

case RK_DRAGONBREATH:case RK_DRAGONBREATH_WATER:{   wd.damage = ((status_get_hp(src) / 50) + (status_get_max_sp(src) / 4)) * skill_lv;				   RE_LVL_DMOD(150);   if(sd)       wd.damage = wd.damage * (95 + 5 * pc->checkskill(sd,RK_DRAGONTRAINING)) / 100;   wd.damage = battle->attr_fix(src, target, battle->calc_cardfix2(src, target, wd.damage, s_ele, nk, wd.flag), s_ele, tstatus->def_ele, tstatus->ele_lv);   wd.flag |= BF_LONG|BF_WEAPON;}break;

 
Move to line 4301 and add this before flag.weapon = 0:

case RK_DRAGONBREATH:case RK_DRAGONBREATH_WATER:

 

Move to line 3005 and replace:

		if(sc->data[SC_FOGWALL]) {			if(flag&BF_SKILL) { //25% reduction				if ( !(skill->get_inf(skill_id)&INF_GROUND_SKILL) && !(skill->get_nk(skill_id)&NK_SPLASH) )					damage -= 25*damage/100;			} else if ((flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) {				damage >>= 2; //75% reduction			}		}

 
with:

   	 if(sc->data[SC_FOGWALL] && skill_id != RK_DRAGONBREATH && skill_id != RK_DRAGONBREATH_WATER) {            if(flag&BF_SKILL) { //25% reduction                if ( !(skill->get_inf(skill_id)&INF_GROUND_SKILL) && !(skill->get_nk(skill_id)&NK_SPLASH) )                    damage -= 25*damage/100;            } else if ((flag&(BF_LONG|BF_WEAPON)) == (BF_LONG|BF_WEAPON)) {                damage >>= 2; //75% reduction            }        }

 
Move to line 2662 and replace:

if( sc->data[SC_LKCONCENTRATION] )    skillratio += sc->data[SC_LKCONCENTRATION]->val2;

 
with:

if( sc->data[SC_LKCONCENTRATION] && (skill_id != RK_DRAGONBREATH && skill_id != RK_DRAGONBREATH_WATER))    skillratio += sc->data[SC_LKCONCENTRATION]->val2;

 
In skill.c, move to line 2792 and remove both DB entries, add this block below:

if( sd && src != bl && damage > 0 && ( dmg.flag&BF_LONG && (skill_id == RK_DRAGONBREATH || skill_id == RK_DRAGONBREATH_WATER)) )    {        if (battle_config.left_cardfix_to_right)            battle->drain(sd, bl, dmg.damage, dmg.damage, tstatus->race, tstatus->mode&MD_BOSS);        else            battle->drain(sd, bl, dmg.damage, dmg.damage2, tstatus->race, tstatus->mode&MD_BOSS);    }

 

Move to line 4231 and replace:

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);}     break;

 

with:

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_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag);}     break;

 
For skill_db entries:

2008,9,6,2,3,0x42,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0,0,weapon,0,	RK_DRAGONBREATH,Dragon Breath5004,9,6,2,1,0x42,1:1:1:2:2:2:3:3:4:4,10,1,no,0,0,0,weapon,0,	RK_DRAGONBREATH_WATER,Dragon Breath - Water

 
For skill_cast_db entries:

//-- RK_DRAGONBREATH2008,0:0:0:1000:1000:1000:1500:1500:2000:2000,2000,0,0,15000,200,500//-- RK_DRAGONBREATH_WATER5004,0:0:0:1000:1000:1000:1500:1500:2000:2000,2000,0,0,13000,200,500

 
 
You may also want to add exceptions to Neutral Barrier to not block it from both inside and outside if you have coded that part yourself as it isn't in the current Hercules version.

Edited by Anisotropic Defixation

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.