From 305486b4208e448434a4380f7bb6c5cf1848c907 Mon Sep 17 00:00:00 2001 From: killerwife Date: Sun, 2 Jul 2023 17:25:32 +0200 Subject: [PATCH] Unit/Spell: Resolve weapon skill not being applied to a couple melee abilities --- src/game/Entities/Unit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 1c73b88483..0270c57170 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -3687,7 +3687,6 @@ float Unit::CalculateEffectiveMissChance(const Unit *victim, WeaponAttackType at if (chance < 0.005f) return 0.0f; const bool ranged = (attType == RANGED_ATTACK); - const bool weapon = (!ability || ability->EquippedItemClass == ITEM_CLASS_WEAPON); // Check if dual wielding, add additional miss penalty - when mainhand has on next swing spell, offhand doesnt suffer penalty if (!ability && !ranged && hasOffhandWeaponForAttack() && (!m_currentSpells[CURRENT_MELEE_SPELL] || !IsNextMeleeSwingSpell(m_currentSpells[CURRENT_MELEE_SPELL]->m_spellInfo))) chance += 19.0f; @@ -3695,7 +3694,7 @@ float Unit::CalculateEffectiveMissChance(const Unit *victim, WeaponAttackType at // a) Victim's level is higher // b) Victim has additional defense skill bonuses const bool vsPlayerOrPet = victim->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED); - const uint32 skill = (weapon ? GetWeaponSkillValue(attType, victim) : GetSkillMaxForLevel(victim)); + const uint32 skill = GetWeaponSkillValue(attType, victim); int32 difference = int32(victim->GetDefenseSkillValue(this) - skill); // Defense/weapon skill factor: for players and NPCs float factor = 0.04f;