fix(Core/Spells): Fingers of Frost should always proc alongside with … (#13008)

...Frostbite.
This commit is contained in:
UltraNix
2022-09-19 05:52:37 +02:00
committed by GitHub
parent 557f6ba6aa
commit f658c8ea0c
3 changed files with 26 additions and 3 deletions

View File

@@ -1450,6 +1450,26 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
else
target->AddAura(74396, target);
}
break;
case 12494: // Frostbite, synchronise with Fingers of Frost
{
// Find Fingers of Frost
if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_MAGE, 2947, EFFECT_0))
{
if (SpellInfo const* triggeringSpellInfo = GetTriggeredByAuraSpellInfo())
{
uint8 fbRank = sSpellMgr->GetSpellRank(triggeringSpellInfo->Id);
uint8 fofRank = sSpellMgr->GetSpellRank(aurEff->GetId());
uint8 chance = uint8(std::ceil(fofRank * fbRank * 16.6f));
if (roll_chance_i(chance))
{
caster->CastSpell(caster, aurEff->GetSpellInfo()->Effects[EFFECT_0].TriggerSpell, true);
}
}
}
break;
}
default:
break;
}

View File

@@ -3278,12 +3278,14 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask)
}
else
{
m_caster->CastCustomSpell(i->triggeredSpell->Id, SPELLVALUE_AURA_DURATION, _duration, unit, true);
AuraEffect const* triggeringAuraEffect = m_caster->GetAuraEffect(i->triggeredByAura->Id, i->triggeredByEffIdx);
m_caster->CastCustomSpell(i->triggeredSpell->Id, SPELLVALUE_AURA_DURATION, _duration, unit, true, nullptr, triggeringAuraEffect);
}
}
else
{
m_caster->CastSpell(unit, i->triggeredSpell, true);
AuraEffect const* triggeringAuraEffect = m_caster->GetAuraEffect(i->triggeredByAura->Id, i->triggeredByEffIdx);
m_caster->CastSpell(unit, i->triggeredSpell, true, nullptr, triggeringAuraEffect);
}
}
}
@@ -8766,6 +8768,7 @@ void Spell::PrepareTriggersExecutedOnHit()
HitTriggerSpell spellTriggerInfo;
spellTriggerInfo.triggeredSpell = spellInfo;
spellTriggerInfo.triggeredByAura = auraSpellInfo;
spellTriggerInfo.triggeredByEffIdx = (*i)->GetEffIndex();
spellTriggerInfo.chance = chance * (*i)->GetBase()->GetStackAmount();
m_hitTriggerSpells.push_back(spellTriggerInfo);
}

View File

@@ -741,7 +741,7 @@ public:
{
SpellInfo const* triggeredSpell;
SpellInfo const* triggeredByAura;
// uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now
uint8 triggeredByEffIdx;
int32 chance;
};