mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Spells: fixed display hit chance changes of SPELL_AURA_MOD_HIT_CHANCE in the character panel
This commit is contained in:
@@ -1833,6 +1833,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void UpdateMeleeHitChances();
|
||||
void UpdateRangedHitChances();
|
||||
void UpdateSpellHitChances();
|
||||
void UpdateHitChances();
|
||||
|
||||
void UpdateAllSpellCritChances();
|
||||
void UpdateSpellCritChance(uint32 school);
|
||||
|
||||
@@ -696,6 +696,12 @@ void Player::UpdateSpellHitChances()
|
||||
m_modSpellHitChance += GetRatingBonusValue(CR_HIT_SPELL);
|
||||
}
|
||||
|
||||
void Player::UpdateHitChances()
|
||||
{
|
||||
float modifier = (float)GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
|
||||
SetFloatValue(PLAYER_FIELD_UI_HIT_MODIFIER, modifier);
|
||||
}
|
||||
|
||||
void Player::UpdateAllSpellCritChances()
|
||||
{
|
||||
for (int i = SPELL_SCHOOL_NORMAL; i < MAX_SPELL_SCHOOL; ++i)
|
||||
|
||||
@@ -118,7 +118,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT
|
||||
&AuraEffect::HandleAuraModWeaponCritPercent, // 52 SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
|
||||
&AuraEffect::HandleNoImmediateEffect, // 53 SPELL_AURA_PERIODIC_LEECH implemented in AuraEffect::PeriodicTick
|
||||
&AuraEffect::HandleNoImmediateEffect, // 54 SPELL_AURA_MOD_HIT_CHANCE
|
||||
&AuraEffect::HandleModHitChance, // 54 SPELL_AURA_MOD_HIT_CHANCE
|
||||
&AuraEffect::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE
|
||||
&AuraEffect::HandleAuraTransform, // 56 SPELL_AURA_TRANSFORM
|
||||
&AuraEffect::HandleModSpellCritChance, // 57 SPELL_AURA_MOD_SPELL_CRIT_CHANCE
|
||||
@@ -3862,6 +3862,17 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u
|
||||
target->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float(GetAmount()), apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
||||
return;
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateHitChances();
|
||||
}
|
||||
|
||||
void AuraEffect::HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
|
||||
|
||||
@@ -246,6 +246,7 @@ class TC_GAME_API AuraEffect
|
||||
void HandleAuraModBlockPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModRegenInterrupt(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChance(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleModSpellCritChanceShool(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
Reference in New Issue
Block a user