diff options
author | Chaplain <aionthefirst@gmail.com> | 2011-09-25 16:42:12 +0300 |
---|---|---|
committer | Chaplain <aionthefirst@gmail.com> | 2011-09-25 16:42:12 +0300 |
commit | 224bb96deb881d1ea4a0eded92016b4b7172d182 (patch) | |
tree | 46aadf9e004c7dc755829545b367536f74eb54a7 /src | |
parent | 877579d3864c504389b271f38a7516f2ec0eeb25 (diff) |
Core/Spells: Fix talent Sword Specialization.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 15 | ||||
-rwxr-xr-x | src/server/game/Entities/Unit/Unit.h | 1 | ||||
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 4 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2d663f83856..7bca9f97d88 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1968,7 +1968,7 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext return; // ignore ranged case // melee attack spell casted at main hand attack only - no normal melee dmg dealt - if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL]) + if (attType == BASE_ATTACK && m_currentSpells[CURRENT_MELEE_SPELL] && !extra) m_currentSpells[CURRENT_MELEE_SPELL]->cast(); else { @@ -1993,15 +1993,14 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); } +} - if (!extra && m_extraAttacks) +void Unit::HandleProcExtraAttackFor(Unit* victim) +{ + while (m_extraAttacks) { - while(m_extraAttacks) - { - AttackerStateUpdate(victim, BASE_ATTACK, true); - if (m_extraAttacks > 0) - --m_extraAttacks; - } + AttackerStateUpdate(victim, BASE_ATTACK, true); + --m_extraAttacks; } } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index c54a627fa27..e25a5a9bcf9 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1455,6 +1455,7 @@ class Unit : public WorldObject void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss); + void HandleProcExtraAttackFor(Unit* victim); void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false); void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 68dde527ab7..99b7e30e906 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3472,6 +3472,10 @@ void Spell::_handle_finish_phase() if (m_comboPointGain) m_caster->m_movedPlayer->GainSpellComboPoints(m_comboPointGain); } + + if (m_caster->m_extraAttacks && GetSpellInfo()->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + m_caster->HandleProcExtraAttackFor(m_caster->getVictim()); + // TODO: trigger proc phase finish here } |