fix(Core/Spells): Implement ENCHANT_PROC_ATTR_WHITE_HIT (#16771)

Co-authored-by: Ariel Silva<ariel-@users.noreply.github.com>
This commit is contained in:
Angelo Venturini
2023-07-17 08:19:24 -03:00
committed by GitHub
parent 891d7bd47c
commit dbc39a2817
3 changed files with 9 additions and 5 deletions

View File

@@ -7224,6 +7224,9 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
continue;
}
if (entry && (entry->attributeMask & ENCHANT_PROC_ATTR_WHITE_HIT) && (procVictim & SPELL_PROC_FLAG_MASK))
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->spellid[s]);
if (!spellInfo)
{
@@ -7272,10 +7275,8 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
item->SetEnchantmentCharges(EnchantmentSlot(e_slot), charges);
}
if (spellInfo->IsPositive())
CastSpell(this, spellInfo, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), item);
else
CastSpell(target, spellInfo, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), item);
Unit* unitTarget = spellInfo->IsPositive() ? this : target;
CastSpell(unitTarget, spellInfo, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), item);
}
}
}