diff --git a/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql b/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql new file mode 100644 index 0000000000..23954b3bee --- /dev/null +++ b/sql/updates/world/3.3.5/2016_12_30_02_world_335.sql @@ -0,0 +1,5 @@ +UPDATE `spell_proc` SET `SpellFamilyMask2`=0, `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId`=-31571; +DELETE FROM `spell_proc` WHERE `SpellId` IN (57529, 57531); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(57529, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0), +(57531, 0, 3, 0x61400035, 0x00001000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index c1b146d7b8..f058c60ee6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7029,7 +7029,34 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto crit_chance = 0.0f; // For other schools else if (GetTypeId() == TYPEID_PLAYER) + { crit_chance = GetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + GetFirstSchoolInMask(schoolMask)); + + // register aura mod, this is needed for Arcane Potency + if (Spell* spell = ToPlayer()->m_spellModTakingSpell) + { + std::vector affectingAuras; + (void)GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE, [&affectingAuras](AuraEffect const* aurEff) -> bool + { + affectingAuras.push_back(aurEff->GetBase()); + return true; + }); + + (void)GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL, [&affectingAuras, schoolMask](AuraEffect const* aurEff) -> bool + { + if ((aurEff->GetMiscValue() & schoolMask) != 0) + { + affectingAuras.push_back(aurEff->GetBase()); + return true; + } + + return false; + }); + + for (Aura* aura : affectingAuras) + spell->m_appliedMods.insert(aura); + } + } else { crit_chance = (float)m_baseSpellCritChance; diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 88f5313381..90532e89df 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1283,24 +1283,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b } switch (GetId()) { - case 12536: // Clearcasting - case 12043: // Presence of Mind - // Arcane Potency - if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, 2120, 0)) - { - uint32 spellId = 0; - - switch (aurEff->GetId()) - { - case 31571: spellId = 57529; break; - case 31572: spellId = 57531; break; - default: - TC_LOG_ERROR("spells", "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency (%d) found", aurEff->GetId()); - } - if (spellId) - caster->CastSpell(caster, spellId, true); - } - break; default: break; }