Fixes Gate of Hell behavior (#5267)
* Fixes #3259. * Fixes SP damage bonus for levels 1-4 being too low caused by a rounding issue. * Gate of Hell is no longer reduced by long range modifiers. * Fixes the HP/SP damage for statusAtk and masteryAtk to properly apply the NK_IGNOREELEMENT flag when checking target players. This subsequently applies to all skills. * Adds a new NK flag to remove any hard coded skills that can ignore long range attack modifiers from the caster's side. Thanks to @Tokeiburu and @exneval!
This commit is contained in:
parent
e78f6ae596
commit
f10de84ea3
@ -24372,6 +24372,8 @@ Body:
|
||||
MaxLevel: 10
|
||||
Type: Weapon
|
||||
TargetType: Attack
|
||||
DamageFlags:
|
||||
IgnoreLongCard: true
|
||||
Range: 7
|
||||
Hit: Multi_Hit
|
||||
HitCount: -7
|
||||
|
@ -56,6 +56,7 @@ IgnoreElement - Skill ignores elemental adjustments.
|
||||
IgnoreDefense - Skill ignores target's defense (Misc type always ignores).
|
||||
IgnoreFlee - Skill ignores target's flee (Magic type always ignores)
|
||||
IgnoreDefCard - Skill ignores target's defense cards.
|
||||
IgnoreLongCard - Skill ignores caster's long range damage cards.
|
||||
Critical - Skill can critical.
|
||||
|
||||
---------------------------------------
|
||||
|
@ -738,7 +738,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
|
||||
//It was discovered that ranged defense also counts vs magic! [Skotlex]
|
||||
if( flag&BF_SHORT )
|
||||
cardfix = cardfix * (100 - tsd->bonus.near_attack_def_rate) / 100;
|
||||
else
|
||||
else if (!nk[NK_IGNORELONGCARD])
|
||||
cardfix = cardfix * (100 - tsd->bonus.long_attack_def_rate) / 100;
|
||||
#endif
|
||||
cardfix = cardfix * (100 - tsd->bonus.magic_def_rate) / 100;
|
||||
@ -944,7 +944,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
|
||||
}
|
||||
if( flag&BF_SHORT )
|
||||
cardfix = cardfix * (100 - tsd->bonus.near_attack_def_rate) / 100;
|
||||
else // BF_LONG (there's no other choice)
|
||||
else if (!nk[NK_IGNORELONGCARD]) // BF_LONG (there's no other choice)
|
||||
cardfix = cardfix * (100 - tsd->bonus.long_attack_def_rate) / 100;
|
||||
if( tsd->sc.data[SC_DEF_RATE] )
|
||||
cardfix = cardfix * (100 - tsd->sc.data[SC_DEF_RATE]->val1) / 100;
|
||||
@ -989,7 +989,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
|
||||
cardfix = cardfix * (100 - tsd->bonus.misc_def_rate) / 100;
|
||||
if( flag&BF_SHORT )
|
||||
cardfix = cardfix * (100 - tsd->bonus.near_attack_def_rate) / 100;
|
||||
else // BF_LONG (there's no other choice)
|
||||
else if (!nk[NK_IGNORELONGCARD]) // BF_LONG (there's no other choice)
|
||||
cardfix = cardfix * (100 - tsd->bonus.long_attack_def_rate) / 100;
|
||||
APPLY_CARDFIX(damage, cardfix);
|
||||
}
|
||||
@ -5831,6 +5831,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
|
||||
#endif
|
||||
}
|
||||
|
||||
std::bitset<NK_MAX> nk = battle_skill_get_damage_properties(skill_id, wd.miscflag);
|
||||
|
||||
// check if we're landing a hit
|
||||
if(!is_attack_hitting(&wd, src, target, skill_id, skill_lv, true))
|
||||
wd.dmg_lv = ATK_FLEE;
|
||||
@ -5871,11 +5873,30 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
|
||||
#ifdef RENEWAL
|
||||
// In Renewal we only cardfix to the weapon and equip ATK
|
||||
//Card Fix for attacker (sd), 2 is added to the "left" flag meaning "attacker cards only"
|
||||
wd.weaponAtk += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.weaponAtk, 2, wd.flag);
|
||||
wd.equipAtk += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.equipAtk, 2, wd.flag);
|
||||
if (is_attack_left_handed(src, skill_id)) {
|
||||
wd.weaponAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.weaponAtk2, 3, wd.flag);
|
||||
wd.equipAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.equipAtk2, 3, wd.flag);
|
||||
if (sd) {
|
||||
wd.weaponAtk += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.weaponAtk, 2, wd.flag);
|
||||
wd.equipAtk += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.equipAtk, 2, wd.flag);
|
||||
if (is_attack_left_handed(src, skill_id)) {
|
||||
wd.weaponAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.weaponAtk2, 3, wd.flag);
|
||||
wd.equipAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.equipAtk2, 3, wd.flag);
|
||||
}
|
||||
|
||||
//Card Fix for target (tsd), 2 is not added to the "left" flag meaning "target cards only"
|
||||
if (tsd) {
|
||||
std::bitset<NK_MAX> ignoreele_nk = nk;
|
||||
|
||||
ignoreele_nk.set(NK_IGNOREELEMENT);
|
||||
wd.statusAtk += battle_calc_cardfix(BF_WEAPON, src, target, ignoreele_nk, right_element, left_element, wd.statusAtk, 0, wd.flag);
|
||||
wd.weaponAtk += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.weaponAtk, 0, wd.flag);
|
||||
wd.equipAtk += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.equipAtk, 0, wd.flag);
|
||||
wd.masteryAtk += battle_calc_cardfix(BF_WEAPON, src, target, ignoreele_nk, right_element, left_element, wd.masteryAtk, 0, wd.flag);
|
||||
if (is_attack_left_handed(src, skill_id)) {
|
||||
wd.statusAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, ignoreele_nk, right_element, left_element, wd.statusAtk2, 1, wd.flag);
|
||||
wd.weaponAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.weaponAtk2, 1, wd.flag);
|
||||
wd.equipAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.equipAtk2, 1, wd.flag);
|
||||
wd.masteryAtk2 += battle_calc_cardfix(BF_WEAPON, src, target, ignoreele_nk, right_element, left_element, wd.masteryAtk2, 1, wd.flag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// final attack bonuses that aren't affected by cards
|
||||
@ -5945,11 +5966,11 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
|
||||
case SR_GATEOFHELL: {
|
||||
struct status_data *sstatus = status_get_status_data(src);
|
||||
|
||||
ATK_ADD(wd.damage, wd.damage2, sstatus->max_hp - status_get_hp(src));
|
||||
ATK_ADD(wd.damage, wd.damage2, sstatus->max_hp - sstatus->hp);
|
||||
if(sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE) {
|
||||
ATK_ADD(wd.damage, wd.damage2, (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src));
|
||||
ATK_ADD(wd.damage, wd.damage2, (sstatus->max_sp * (100 + skill_lv * 20 / 100)) + 40 * status_get_lv(src));
|
||||
} else
|
||||
ATK_ADD(wd.damage, wd.damage2, (sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src));
|
||||
ATK_ADD(wd.damage, wd.damage2, (sstatus->sp * (100 + skill_lv * 20 / 100)) + 10 * status_get_lv(src));
|
||||
}
|
||||
break;
|
||||
case MH_TINDER_BREAKER:
|
||||
@ -6000,9 +6021,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
|
||||
}
|
||||
break;
|
||||
default:
|
||||
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage, 2, wd.flag);
|
||||
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.damage, 2, wd.flag);
|
||||
if( is_attack_left_handed(src, skill_id ))
|
||||
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage2, 3, wd.flag);
|
||||
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.damage2, 3, wd.flag);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@ -6015,9 +6036,9 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src, struct bl
|
||||
break; //These skills will do a card fix later
|
||||
default:
|
||||
#endif
|
||||
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage, 0, wd.flag);
|
||||
wd.damage += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.damage, 0, wd.flag);
|
||||
if(is_attack_left_handed(src, skill_id))
|
||||
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, battle_skill_get_damage_properties(skill_id, wd.miscflag), right_element, left_element, wd.damage2, 1, wd.flag);
|
||||
wd.damage2 += battle_calc_cardfix(BF_WEAPON, src, target, nk, right_element, left_element, wd.damage2, 1, wd.flag);
|
||||
#ifdef RENEWAL
|
||||
break;
|
||||
}
|
||||
|
@ -7721,6 +7721,7 @@
|
||||
export_constant(NK_IGNOREDEFENSE);
|
||||
export_constant(NK_IGNOREFLEE);
|
||||
export_constant(NK_IGNOREDEFCARD);
|
||||
export_constant(NK_IGNORELONGCARD);
|
||||
export_constant(NK_CRITICAL);
|
||||
|
||||
/* skill inf */
|
||||
|
@ -53,6 +53,7 @@ enum e_skill_nk : uint8 {
|
||||
NK_IGNOREFLEE,
|
||||
NK_IGNOREDEFCARD,
|
||||
NK_CRITICAL,
|
||||
NK_IGNORELONGCARD,
|
||||
NK_MAX,
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user