From bb9e80ded1ecc6f49f58b4f88e9a48395d18aafa Mon Sep 17 00:00:00 2001 From: Skjalf <47818697+Nyeriah@users.noreply.github.com> Date: Sat, 5 Nov 2022 15:04:02 -0300 Subject: [PATCH] =?UTF-8?q?fix(Core/Unit):=20Exclude=20Sword=20Specializat?= =?UTF-8?q?ion=20and=20Hack=20and=20Slash=20from=20=E2=80=A6=20(#13706)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(Core/Unit): Exclude Sword Specialization and Hack and Slash from the extra attack range check * fix logic --- src/server/game/Entities/Unit/Unit.cpp | 5 +++-- src/server/game/Entities/Unit/Unit.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index f330e39da..af91a9597 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -469,7 +469,8 @@ void Unit::Update(uint32 p_time) extraAttacksTargets.erase(itr); if (Unit* victim = ObjectAccessor::GetUnit(*this, targetGuid)) { - if (victim->IsWithinMeleeRange(this)) + if (_lastExtraAttackSpell == SPELL_SWORD_SPECIALIZATION || _lastExtraAttackSpell == SPELL_HACK_AND_SLASH + || victim->IsWithinMeleeRange(this)) { HandleProcExtraAttackFor(victim, count); } @@ -9376,7 +9377,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg // Patch 2.2.0 Sword Specialization (Warrior, Rogue) extra attack can no longer proc additional extra attacks // 3.3.5 Sword Specialization (Warrior), Hack and Slash (Rogue) - if (lastExtraAttackSpell == 16459 || lastExtraAttackSpell == 66923) + if (lastExtraAttackSpell == SPELL_SWORD_SPECIALIZATION || lastExtraAttackSpell == SPELL_HACK_AND_SLASH) { return false; } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 95d52eedc..547e62b14 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -717,6 +717,12 @@ enum MeleeHitOutcome MELEE_HIT_GLANCING, MELEE_HIT_CRIT, MELEE_HIT_CRUSHING, MELEE_HIT_NORMAL }; +enum ExtraAttackSpells +{ + SPELL_SWORD_SPECIALIZATION = 16459, + SPELL_HACK_AND_SLASH = 66923 +}; + class DispelInfo { public: