mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Core/Auras: Implement SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING (#31531)
This commit is contained in:
@@ -5333,6 +5333,9 @@ void Player::UpdateRating(CombatRating cr)
|
||||
if (aurEff->GetMiscValue() & (1 << cr))
|
||||
amount += int32(CalculatePct(amount, aurEff->GetAmount()));
|
||||
|
||||
if (cr == CR_PARRY)
|
||||
amount += m_baseRatingValue[CR_CRIT_MELEE] * (GetTotalAuraMultiplier(SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING) - 1.0f);
|
||||
|
||||
if (amount < 0)
|
||||
amount = 0;
|
||||
|
||||
@@ -5370,6 +5373,7 @@ void Player::UpdateRating(CombatRating cr)
|
||||
UpdateCritPercentage(BASE_ATTACK);
|
||||
UpdateCritPercentage(OFF_ATTACK);
|
||||
}
|
||||
UpdateRating(CR_PARRY);
|
||||
break;
|
||||
case CR_CRIT_RANGED:
|
||||
if (affectStats)
|
||||
|
||||
@@ -547,7 +547,7 @@ enum AuraType : uint32
|
||||
SPELL_AURA_RESET_COOLDOWNS_ON_DUEL_START = 460, // NYI
|
||||
SPELL_AURA_461 = 461,
|
||||
SPELL_AURA_MOD_HEALING_AND_ABSORB_FROM_CASTER = 462, // NYI
|
||||
SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING = 463, // NYI
|
||||
SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING = 463,
|
||||
SPELL_AURA_MOD_ATTACK_POWER_OF_BONUS_ARMOR = 464, // NYI
|
||||
SPELL_AURA_MOD_BONUS_ARMOR = 465,
|
||||
SPELL_AURA_MOD_BONUS_ARMOR_PCT = 466, // Affects bonus armor gain from all sources except base stats
|
||||
|
||||
@@ -532,7 +532,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleNULL, //460 SPELL_AURA_RESET_COOLDOWNS_ON_DUEL_START
|
||||
&AuraEffect::HandleNULL, //461
|
||||
&AuraEffect::HandleNULL, //462 SPELL_AURA_MOD_HEALING_AND_ABSORB_FROM_CASTER
|
||||
&AuraEffect::HandleNULL, //463 SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING used by Riposte
|
||||
&AuraEffect::HandleConvertCritToParry, //463 SPELL_AURA_CONVERT_CRIT_RATING_PCT_TO_PARRY_RATING used by Riposte
|
||||
&AuraEffect::HandleNULL, //464 SPELL_AURA_MOD_ATTACK_POWER_OF_BONUS_ARMOR
|
||||
&AuraEffect::HandleModBonusArmor, //465 SPELL_AURA_MOD_BONUS_ARMOR
|
||||
&AuraEffect::HandleModBonusArmorPercent, //466 SPELL_AURA_MOD_BONUS_ARMOR_PCT
|
||||
@@ -4050,6 +4050,18 @@ void AuraEffect::HandleAuraModMaxPower(AuraApplication const* aurApp, uint8 mode
|
||||
target->HandleStatFlatModifier(unitMod, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleConvertCritToParry(AuraApplication const* aurApp, uint8 mode, bool /*apply*/) const
|
||||
{
|
||||
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
||||
return;
|
||||
|
||||
Player* target = aurApp->GetTarget()->ToPlayer();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
target->UpdateRating(CR_PARRY);
|
||||
}
|
||||
|
||||
/********************************/
|
||||
/*** HEAL & ENERGIZE ***/
|
||||
/********************************/
|
||||
|
||||
@@ -253,6 +253,7 @@ class TC_GAME_API AuraEffect
|
||||
void HandleOverrideAttackPowerBySpellPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModVersatilityByPct(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModMaxPower(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleConvertCritToParry(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// heal and energize
|
||||
void HandleModPowerRegen(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModPowerRegenPCT(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
Reference in New Issue
Block a user