|
@@ -3359,12 +3359,11 @@ static bool attack_ignores_def(struct Damage* wd, struct block_list *src, struct
|
|
/**
|
|
/**
|
|
* This function lists which skills are unaffected by refine bonus, masteries, Star Crumbs and Spirit Spheres
|
|
* This function lists which skills are unaffected by refine bonus, masteries, Star Crumbs and Spirit Spheres
|
|
* This function is also used to determine if atkpercent applies
|
|
* This function is also used to determine if atkpercent applies
|
|
- * @param src: Source of the attack
|
|
|
|
* @param skill_id: Skill being used
|
|
* @param skill_id: Skill being used
|
|
* @param chk_flag: The bonus that is currently being checked for, see e_bonus_chk_flag
|
|
* @param chk_flag: The bonus that is currently being checked for, see e_bonus_chk_flag
|
|
* @return true = bonus applies; false = bonus does not apply
|
|
* @return true = bonus applies; false = bonus does not apply
|
|
*/
|
|
*/
|
|
-static bool battle_skill_stacks_masteries_vvs(struct block_list &src, uint16 skill_id, e_bonus_chk_flag chk_flag)
|
|
|
|
|
|
+static bool battle_skill_stacks_masteries_vvs(uint16 skill_id, e_bonus_chk_flag chk_flag)
|
|
{
|
|
{
|
|
switch (skill_id) {
|
|
switch (skill_id) {
|
|
// PC skills that are unaffected
|
|
// PC skills that are unaffected
|
|
@@ -3389,33 +3388,7 @@ static bool battle_skill_stacks_masteries_vvs(struct block_list &src, uint16 ski
|
|
break;
|
|
break;
|
|
case LK_SPIRALPIERCE:
|
|
case LK_SPIRALPIERCE:
|
|
// Spiral Pierce is influenced only by refine bonus and Star Crumbs for players
|
|
// Spiral Pierce is influenced only by refine bonus and Star Crumbs for players
|
|
- if (src.type == BL_PC && chk_flag != BCHK_REFINE && chk_flag != BCHK_STAR)
|
|
|
|
- return false;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- return true;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * This function lists which skills are unaffected by EDP and the elemental bonus from Magnum Break / EDP
|
|
|
|
- * Unit skills (e.g. Bomb and Freezing Trap) are never affected.
|
|
|
|
- * @param skill_id: Skill being used
|
|
|
|
- * @return true = bonus applies; false = bonus does not apply
|
|
|
|
- */
|
|
|
|
-static bool battle_skill_stacks_edp_element(uint16 skill_id)
|
|
|
|
-{
|
|
|
|
- switch (skill_id) {
|
|
|
|
- case TF_SPRINKLESAND:
|
|
|
|
- case AS_SPLASHER:
|
|
|
|
- case ASC_METEORASSAULT:
|
|
|
|
- case ASC_BREAKER:
|
|
|
|
- case AS_VENOMKNIFE:
|
|
|
|
- case AM_ACIDTERROR:
|
|
|
|
- return false;
|
|
|
|
- default:
|
|
|
|
- //Unit skills
|
|
|
|
- if (skill_get_unit_id(skill_id))
|
|
|
|
|
|
+ if (chk_flag != BCHK_REFINE && chk_flag != BCHK_STAR)
|
|
return false;
|
|
return false;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -3789,12 +3762,12 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
|
|
// These mastery bonuses are non-elemental and should apply even if the attack misses
|
|
// These mastery bonuses are non-elemental and should apply even if the attack misses
|
|
// They are still increased by the EDP/Magnum Break bonus damage (WATK_ELEMENT)
|
|
// They are still increased by the EDP/Magnum Break bonus damage (WATK_ELEMENT)
|
|
// In renewal these bonuses do not apply when the attack misses
|
|
// In renewal these bonuses do not apply when the attack misses
|
|
- if (sd && battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_STAR)) {
|
|
|
|
|
|
+ if (sd && battle_skill_stacks_masteries_vvs(skill_id, BCHK_STAR)) {
|
|
// Star Crumb bonus damage
|
|
// Star Crumb bonus damage
|
|
ATK_ADD2(wd->damage, wd->damage2, sd->right_weapon.star, sd->left_weapon.star);
|
|
ATK_ADD2(wd->damage, wd->damage2, sd->right_weapon.star, sd->left_weapon.star);
|
|
}
|
|
}
|
|
// Check if general mastery bonuses apply (above check is only for Star Crumb)
|
|
// Check if general mastery bonuses apply (above check is only for Star Crumb)
|
|
- if (battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_ALL)) {
|
|
|
|
|
|
+ if (battle_skill_stacks_masteries_vvs(skill_id, BCHK_ALL)) {
|
|
// Spirit Sphere bonus damage
|
|
// Spirit Sphere bonus damage
|
|
ATK_ADD(wd->damage, wd->damage2, battle_get_spiritball_damage(*wd, *src, skill_id));
|
|
ATK_ADD(wd->damage, wd->damage2, battle_get_spiritball_damage(*wd, *src, skill_id));
|
|
|
|
|
|
@@ -3824,10 +3797,10 @@ static void battle_calc_element_damage(struct Damage* wd, struct block_list *src
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // These bonuses do not apply to skills that ignore element, unit skills and skills that have their own base damage formula
|
|
|
|
|
|
+ // These bonuses do not apply to skills that ignore +% damage cards
|
|
// If damage was reduced below 0 and was not increased again to a positive value through mastery bonuses, these bonuses are ignored
|
|
// If damage was reduced below 0 and was not increased again to a positive value through mastery bonuses, these bonuses are ignored
|
|
// Any of these are only applied to your right hand weapon in pre-renewal
|
|
// Any of these are only applied to your right hand weapon in pre-renewal
|
|
- if (!nk[NK_IGNOREELEMENT] && (wd->damage > 0 || wd->damage2 > 0) && sc && battle_skill_stacks_edp_element(skill_id)) {
|
|
|
|
|
|
+ if (!nk[NK_IGNOREELEMENT] && !nk[NK_IGNOREATKCARD] && (wd->damage > 0 || wd->damage2 > 0) && sc) {
|
|
|
|
|
|
// EDP bonus damage
|
|
// EDP bonus damage
|
|
// This has to be applied after mastery bonuses but still before the elemental extra damage
|
|
// This has to be applied after mastery bonuses but still before the elemental extra damage
|
|
@@ -3873,7 +3846,7 @@ static void battle_calc_attack_masteries(struct Damage* wd, struct block_list *s
|
|
}
|
|
}
|
|
|
|
|
|
// Check if mastery damage applies to current skill
|
|
// Check if mastery damage applies to current skill
|
|
- if (sd && battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_ALL))
|
|
|
|
|
|
+ if (sd && battle_skill_stacks_masteries_vvs(skill_id, BCHK_ALL))
|
|
{ //Add mastery damage
|
|
{ //Add mastery damage
|
|
uint16 skill;
|
|
uint16 skill;
|
|
|
|
|
|
@@ -4459,7 +4432,7 @@ static void battle_calc_multi_attack(struct Damage* wd, struct block_list *src,s
|
|
*/
|
|
*/
|
|
static unsigned short battle_get_atkpercent(struct block_list& bl, uint16 skill_id, status_change& sc)
|
|
static unsigned short battle_get_atkpercent(struct block_list& bl, uint16 skill_id, status_change& sc)
|
|
{
|
|
{
|
|
- if (!battle_skill_stacks_masteries_vvs(bl, skill_id, BCHK_ALL))
|
|
|
|
|
|
+ if (bl.type == BL_PC && !battle_skill_stacks_masteries_vvs(skill_id, BCHK_ALL))
|
|
return 100;
|
|
return 100;
|
|
|
|
|
|
int atkpercent = 100;
|
|
int atkpercent = 100;
|
|
@@ -6709,7 +6682,7 @@ static void battle_calc_attack_post_defense(struct Damage* wd, struct block_list
|
|
#ifndef RENEWAL
|
|
#ifndef RENEWAL
|
|
//Refine bonus
|
|
//Refine bonus
|
|
if (sd) {
|
|
if (sd) {
|
|
- if (battle_skill_stacks_masteries_vvs(*src, skill_id, BCHK_REFINE)) {
|
|
|
|
|
|
+ if (battle_skill_stacks_masteries_vvs(skill_id, BCHK_REFINE)) {
|
|
ATK_ADD2(wd->damage, wd->damage2, sstatus->rhw.atk2, sstatus->lhw.atk2);
|
|
ATK_ADD2(wd->damage, wd->damage2, sstatus->rhw.atk2, sstatus->lhw.atk2);
|
|
}
|
|
}
|
|
wd->basedamage += sstatus->rhw.atk2;
|
|
wd->basedamage += sstatus->rhw.atk2;
|