mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 21:45:12 +00:00
fix(Core/Spells): Fix Arcane Potency consumed by same cast that triggered it (#24997)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: ariel- <ariel-@users.noreply.github.com>
This commit is contained in:
@@ -8977,7 +8977,22 @@ float Unit::SpellDoneCritChance(Unit const* /*victim*/, SpellInfo const* spellPr
|
||||
crit_chance = 0.0f;
|
||||
// For other schools
|
||||
else if (IsPlayer())
|
||||
{
|
||||
crit_chance = GetFloatValue(static_cast<uint16>(PLAYER_SPELL_CRIT_PERCENTAGE1) + GetFirstSchoolInMask(schoolMask));
|
||||
|
||||
// register aura mod, this is needed for Arcane Potency
|
||||
if (Spell* spell = ToPlayer()->m_spellModTakingSpell)
|
||||
{
|
||||
Unit::AuraEffectList const& critAuras = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
|
||||
for (AuraEffect const* aurEff : critAuras)
|
||||
spell->m_appliedMods.insert(aurEff->GetBase());
|
||||
|
||||
Unit::AuraEffectList const& critSchoolAuras = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL);
|
||||
for (AuraEffect const* aurEff : critSchoolAuras)
|
||||
if (aurEff->GetMiscValue() & schoolMask)
|
||||
spell->m_appliedMods.insert(aurEff->GetBase());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
crit_chance = (float)m_baseSpellCritChance;
|
||||
|
||||
@@ -1348,28 +1348,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:
|
||||
LOG_ERROR("spells.aura", "Aura::HandleAuraSpecificMods: Unknown rank of Arcane Potency ({}) found", aurEff->GetId());
|
||||
}
|
||||
if (spellId)
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
}
|
||||
break;
|
||||
case 44544: // Fingers of Frost
|
||||
{
|
||||
// See if we already have the indicator aura. If not, create one.
|
||||
|
||||
@@ -1963,7 +1963,8 @@ void SpellMgr::LoadSpellProcs()
|
||||
if (!spellInfo->Effects[i].IsAura())
|
||||
continue;
|
||||
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_PCT_MODIFIER || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_FLAT_MODIFIER)
|
||||
if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_PCT_MODIFIER || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_ADD_FLAT_MODIFIER
|
||||
|| spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_SPELL_CRIT_CHANCE || spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_SPELL_CRIT_CHANCE_SCHOOL)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user