Modification for bonus bDefRatioAtkRace

ThyroDree

New member
Messages
556
Points
0
Location
Philippines
Github
bosxkate23
Emulator
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

Code:
			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;
				}
			}
 
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.

 
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

 
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)

 
Last edited by a moderator:
Back
Top