fix(Core/Unit): dodges, parries and critters not increasing weapon skills (#5895)

This fixes not getting skill ups from attacking an enemy and them parrying your attack or dodging it.
This also fixes attacking a critter and not getting weapon skill ups.
Previously Dodge and Parry were only giving a chance to increase the victims DEFENSE skill.
I changed it so it will proc on victim and attacker. for weapon and defense skills
Also, critters were being checked to not give weapon skill ups on purpose but I removed the check.
This commit is contained in:
Maxpro
2021-06-12 15:39:14 -07:00
committed by GitHub
parent f2c1aaa45e
commit 1b896277bd

View File

@@ -15535,14 +15535,14 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
!target->IsPet()
)
{
// On melee based hit/miss/resist need update skill (for victim and attacker)
if (procExtra & (PROC_EX_NORMAL_HIT | PROC_EX_MISS | PROC_EX_RESIST))
// On melee based hit/miss/resist/parry/dodge need to update skill (for victim and attacker)
if (procExtra & (PROC_EX_NORMAL_HIT | PROC_EX_MISS | PROC_EX_RESIST | PROC_EX_PARRY | PROC_EX_DODGE))
{
if (target->GetTypeId() != TYPEID_PLAYER && !target->IsCritter())
if (target->GetTypeId() != TYPEID_PLAYER)
ToPlayer()->UpdateCombatSkills(target, attType, isVictim);
}
// Update defence if player is victim and parry/dodge/block
else if (isVictim && procExtra & (PROC_EX_DODGE | PROC_EX_PARRY | PROC_EX_BLOCK))
// Update defence if player is victim and we block
else if (isVictim && procExtra & (PROC_EX_BLOCK))
ToPlayer()->UpdateCombatSkills(target, attType, true);
}
// If exist crit/parry/dodge/block need update aura state (for victim and attacker)