Skip to content

Commit

Permalink
Unit/Spell: Resolve weapon skill not being applied to a couple melee …
Browse files Browse the repository at this point in the history
…abilities
  • Loading branch information
killerwife committed Jul 2, 2023
1 parent 1ffc3a5 commit 305486b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3687,15 +3687,14 @@ 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);

This comment has been minimized.

Copy link
@Warlockbugs

Warlockbugs Jul 2, 2023

Member

Regressions incoming. There were reasons for this check to be in there in the first place.

// 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;
// Skill difference can be both negative and positive. Positive difference means that:
// 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;
Expand Down

0 comments on commit 305486b

Please sign in to comment.