mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 09:33:47 +00:00
fix(Core/Combat): Improved extra attacks handling. Author: @trickerer (#11169)
Fixes #9423 Fixes #11138
This commit is contained in:
@@ -2605,6 +2605,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
// Do damage and triggers
|
||||
else if (m_damage > 0)
|
||||
{
|
||||
caster->SetLastDamagedTargetGuid(unitTarget->GetGUID());
|
||||
|
||||
// Fill base damage struct (unitTarget - is real spell target)
|
||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo, m_spellSchoolMask);
|
||||
|
||||
@@ -4049,8 +4051,10 @@ void Spell::_handle_finish_phase()
|
||||
m_caster->AddComboPoints(m_comboTarget, m_comboPointGain);
|
||||
}
|
||||
|
||||
if (m_caster->m_extraAttacks && GetSpellInfo()->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
m_caster->HandleProcExtraAttackFor(m_caster->GetVictim());
|
||||
if (m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
|
||||
{
|
||||
m_caster->SetLastExtraAttackSpell(m_spellInfo->Id);
|
||||
}
|
||||
|
||||
if (!IsAutoRepeat() && !IsNextMeleeSwingSpell())
|
||||
if (m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
|
||||
@@ -4664,17 +4664,18 @@ void Spell::EffectResurrect(SpellEffIndex effIndex)
|
||||
void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex)
|
||||
{
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!unitTarget || !unitTarget->IsAlive() || !unitTarget->GetVictim())
|
||||
if (!unitTarget || !unitTarget->IsAlive())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (unitTarget->m_extraAttacks)
|
||||
return;
|
||||
unitTarget->AddExtraAttacks(damage);
|
||||
|
||||
unitTarget->m_extraAttacks = damage;
|
||||
|
||||
ExecuteLogEffectExtraAttacks(effIndex, unitTarget->GetVictim(), damage);
|
||||
ExecuteLogEffectExtraAttacks(effIndex, unitTarget, damage);
|
||||
}
|
||||
|
||||
void Spell::EffectParry(SpellEffIndex /*effIndex*/)
|
||||
|
||||
Reference in New Issue
Block a user