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;
|
||||
|
||||
Reference in New Issue
Block a user