Jump to content
  • 0
ThyroDree

Modification for bonus bDefRatioAtkRace

Question

Hello again 🤣

Anyone can help me make DefRatioAtkRace only ignores (Soft)VIT Base Defense? I think i found its source code yet i dont know which is the hard defense and soft defense.

 

pc.c

		case SP_DEF_RATIO_ATK_RACE:
		{
			uint32 race_mask = map->race_id2mask(val);
			if (race_mask == RCMASK_NONE) {
				ShowWarning("pc_bonus: SP_DEF_RATIO_ATK_RACE: Invalid Race (%d)\n", val);
				break;
			}
			if (!sd->state.lr_flag)
				sd->right_weapon.def_ratio_atk_race |= race_mask;
			else if (sd->state.lr_flag == 1)
				sd->left_weapon.def_ratio_atk_race |= race_mask;
		}

battle.c

			if (skill_id != PA_SACRIFICE && skill_id != MO_INVESTIGATE && skill_id != CR_GRANDCROSS && skill_id != NPC_GRANDDARKNESS && skill_id != PA_SHIELDCHAIN && !flag.cri) {
				//Elemental/Racial adjustments
				if (sd->right_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele)
				 || sd->right_weapon.def_ratio_atk_race & map->race_id2mask(tstatus->race)
				 || sd->right_weapon.def_ratio_atk_race & map->race_id2mask(is_boss(target) ? RC_BOSS : RC_NONBOSS)
				)
					flag.pdef = 1;

				if (sd->left_weapon.def_ratio_atk_ele & (1<<tstatus->def_ele)
				 || sd->left_weapon.def_ratio_atk_race & map->race_id2mask(tstatus->race)
				 || sd->left_weapon.def_ratio_atk_race & map->race_id2mask(is_boss(target) ? RC_BOSS : RC_NONBOSS)
				) {
					//Pass effect onto right hand if configured so. [Skotlex]
					if (battle_config.left_cardfix_to_right && flag.rh)
						flag.pdef = 1;
					else
						flag.pdef2 = 1;
				}
			}

 

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

anyone?

The normal thanatos card ignores both soft and hard defense am I right?

On this is like Thanatos Card making it only ignore the (soft) VIT base defense.

Share this post


Link to post
Share on other sites
  • 0

Hi.

 

Have a look at battle_calc_defense() in src/map/battle.c.
If I remember correctly, you're running your server in pre-RE mode, so I guess you're most interested in this line:

damage = damage * pdef * (def1+vit_def) / 100;

 

 

~Kenpachi

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Kenpachi said:

Hi.

 

Have a look at battle_calc_defense() in src/map/battle.c.
If I remember correctly, you're running your server in pre-RE mode, so I guess you're most interested in this line:

damage = damage * pdef * (def1+vit_def) / 100;


damage = damage * pdef * (def1+vit_def) / 100;

 

 

~Kenpachi

By changing that line into this

damage = damage * pdef * (vit_def) / 100;

because DEF1 is equipment defense (hard defense). Im still confused with mdef1,mdef2, & def1,def2😃

 

makes it only consider vit base defense? (if player uses ice pick or thanatos that has Def ratio attack will only consider vit base defense)

 

Edited by ThyroDree

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

×
×
  • Create New...

Important Information

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