diff options
-rw-r--r-- | src/game/ObjectMgr.cpp | 1 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellAuraDefines.h | 4 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 24 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 3 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 1 | ||||
-rw-r--r-- | src/game/StatSystem.cpp | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 3 |
8 files changed, 30 insertions, 10 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 216ee2ece7c..32832f0544c 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -130,7 +130,6 @@ bool SpellClickInfo::IsFitToRequirements(Player const* player, Creature const * if (!player->HasAura(auraRequired)) return false; - sLog.outError("Aura forbid: %d", auraForbidden); if (auraForbidden) if (player->HasAura(auraForbidden)) return false; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 18a5e48e913..e7630948d1d 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -7096,7 +7096,7 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply) { - AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT); + AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); for(AuraEffectList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr) _ApplyWeaponDependentAuraCritMod(item,attackType,*itr,apply); diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 715e689d688..d25ac1659b3 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -97,7 +97,7 @@ enum AuraType SPELL_AURA_MOD_DODGE_PERCENT = 49, SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT = 50, SPELL_AURA_MOD_BLOCK_PERCENT = 51, - SPELL_AURA_MOD_CRIT_PERCENT = 52, + SPELL_AURA_MOD_WEAPON_CRIT_PERCENT = 52, SPELL_AURA_PERIODIC_LEECH = 53, SPELL_AURA_MOD_HIT_CHANCE = 54, SPELL_AURA_MOD_SPELL_HIT_CHANCE = 55, @@ -335,7 +335,7 @@ enum AuraType SPELL_AURA_DEFLECT_SPELLS, SPELL_AURA_288, SPELL_AURA_289, - SPELL_AURA_MOD_CRIT_CHANCE, + SPELL_AURA_MOD_CRIT_PCT, SPELL_AURA_MOD_XP_QUEST_PCT, SPELL_AURA_292, SPELL_AURA_293, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 860cbc1fec0..738c011a489 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -105,7 +105,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT &Aura::HandleNoImmediateEffect, // 50 SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT implemented in Unit::SpellCriticalHealingBonus &Aura::HandleAuraModBlockPercent, // 51 SPELL_AURA_MOD_BLOCK_PERCENT - &Aura::HandleAuraModCritPercent, // 52 SPELL_AURA_MOD_CRIT_PERCENT + &Aura::HandleAuraModWeaponCritPercent, // 52 SPELL_AURA_MOD_WEAPON_CRIT_PERCENT &Aura::HandlePeriodicLeech, // 53 SPELL_AURA_PERIODIC_LEECH &Aura::HandleModHitChance, // 54 SPELL_AURA_MOD_HIT_CHANCE &Aura::HandleModSpellHitChance, // 55 SPELL_AURA_MOD_SPELL_HIT_CHANCE @@ -337,13 +337,13 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleNoImmediateEffect, //281 SPELL_AURA_MOD_HONOR_GAIN_PCT implemented in Player::RewardHonor &Aura::HandleAuraIncreaseBaseHealthPercent, //282 SPELL_AURA_INCREASE_BASE_HEALTH_PERCENT &Aura::HandleNoImmediateEffect, //283 SPELL_AURA_MOD_HEALING_RECEIVED implemented in Unit::SpellHealingBonus - &Aura::HandleNULL, //284 SPELL_AURA_LINKED - probably not sent to client + &Aura::HandleNULL, //284 SPELL_AURA_LINKED &Aura::HandleAuraModAttackPowerOfArmor, //285 SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR implemented in Player::UpdateAttackPowerAndDamage &Aura::HandleNoImmediateEffect, //286 SPELL_AURA_ABILITY_PERIODIC_CRIT implemented in AuraEffect::PeriodicTick &Aura::HandleNoImmediateEffect, //287 SPELL_AURA_DEFLECT_SPELLS implemented in Unit::MagicSpellHitResult and Unit::MeleeSpellHitResult &Aura::HandleUnused, //288 unused &Aura::HandleUnused, //289 unused - &Aura::HandleNULL, //290 mod all critical hit chances? + &Aura::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT &Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest &Aura::HandleNULL, //292 call stabled pet &Aura::HandleNULL, //293 2 test spells @@ -4950,7 +4950,7 @@ void AuraEffect::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real, bool cha ((Player*)m_target)->UpdateManaRegen(); } -void AuraEffect::HandleAuraModCritPercent(bool apply, bool Real, bool changeAmount) +void AuraEffect::HandleAuraModWeaponCritPercent(bool apply, bool Real, bool changeAmount) { if(m_target->GetTypeId()!=TYPEID_PLAYER) return; @@ -6830,6 +6830,22 @@ void AuraEffect::HandleAuraCloneCaster( bool Apply, bool Real , bool /*changeAmo } } +void AuraEffect::HandleAuraModCritPct(bool apply, bool Real, bool changeAmount) +{ + if(m_target->GetTypeId() != TYPEID_PLAYER) + { + m_target->m_baseSpellCritChance += apply ? m_amount:-m_amount; + return; + } + + if(Real || changeAmount) + ((Player*)m_target)->UpdateAllSpellCritChances(); + + ((Player*)m_target)->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply); + ((Player*)m_target)->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply); + ((Player*)m_target)->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (m_amount), apply); +} + int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster) { // Damage cap for CC effects diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 9c3b170a04c..d3f3ade9b01 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -248,7 +248,7 @@ class TRINITY_DLL_SPEC AuraEffect void HandleAuraModParryPercent(bool Apply, bool Real, bool changeAmount); void HandleAuraModDodgePercent(bool Apply, bool Real, bool changeAmount); void HandleAuraModBlockPercent(bool Apply, bool Real, bool changeAmount); - void HandleAuraModCritPercent(bool Apply, bool Real, bool changeAmount); + void HandleAuraModWeaponCritPercent(bool Apply, bool Real, bool changeAmount); void HandlePeriodicLeech(bool Apply, bool Real, bool changeAmount); void HandleModHitChance(bool Apply, bool Real, bool changeAmount); void HandleModSpellHitChance(bool Apply, bool Real, bool changeAmount); @@ -327,6 +327,7 @@ class TRINITY_DLL_SPEC AuraEffect void HandleCharmConvert(bool apply, bool Real, bool changeAmount); void HandleAuraInitializeImages(bool Apply, bool Real, bool changeAmount); void HandleAuraCloneCaster(bool Apply, bool Real, bool changeAmount); + void HandleAuraModCritPct(bool Apply, bool Real, bool changeAmount); void HandleAuraEffectSpecificMods(bool apply, bool Real, bool changeAmount); int32 CalculateCrowdControlAuraAmount(Unit * caster); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 03626d9f7e7..321e9e26673 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -795,6 +795,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con if(spellproto->CalculateSimpleValue(effIndex) > 0) return false; break; + case SPELL_AURA_MOD_CRIT_PCT: case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: if(spellproto->CalculateSimpleValue(effIndex) > 0) return true; // some expected positive spells have SPELL_ATTR_EX_NEGATIVE diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp index d6a0d737d7b..2b147c5150a 100644 --- a/src/game/StatSystem.cpp +++ b/src/game/StatSystem.cpp @@ -619,6 +619,8 @@ void Player::UpdateSpellCritChance(uint32 school) crit += GetSpellCritFromIntellect(); // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE crit += GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + // Increase crit from SPELL_AURA_MOD_CRIT_PCT + crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); // Increase crit by school from SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL crit += GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, 1<<school); // Increase crit from spell crit ratings diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 7e6e304b9ea..41076313567 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3082,7 +3082,8 @@ float Unit::GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVict else { crit = 5.0f; - crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PERCENT); + crit += GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); + crit += GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT); } // flat aura mods |