Core/Auras: define and implement attribute SPELL_ATTR3_NO_PROC_EQUIP_REQUIREMENT

Closes #20148

(cherry picked from commit 29c3b7d8f6)
This commit is contained in:
ariel-
2018-01-18 16:08:24 -03:00
committed by Shauren
parent 62c571076e
commit b27e741096
2 changed files with 20 additions and 20 deletions

View File

@@ -482,7 +482,7 @@ enum SpellAttr2
enum SpellAttr3
{
SPELL_ATTR3_UNK0 = 0x00000001, // 0
SPELL_ATTR3_UNK1 = 0x00000002, // 1
SPELL_ATTR3_NO_PROC_EQUIP_REQUIREMENT = 0x00000002, // 1 Ignores subclass mask check when checking proc
SPELL_ATTR3_UNK2 = 0x00000004, // 2
SPELL_ATTR3_BLOCKABLE_SPELL = 0x00000008, // 3 Only dmg class melee in 3.1.3
SPELL_ATTR3_IGNORE_RESURRECTION_TIMER = 0x00000010, // 4 you don't have to wait to be resurrected with these spells

View File

@@ -1720,29 +1720,29 @@ uint32 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo
Unit* target = aurApp->GetTarget();
if (IsPassive() && target->GetTypeId() == TYPEID_PLAYER)
{
if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_WEAPON)
if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_NO_PROC_EQUIP_REQUIREMENT))
{
if (target->ToPlayer()->IsInFeralForm())
return 0;
if (DamageInfo* damageInfo = eventInfo.GetDamageInfo())
Item* item = nullptr;
if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_WEAPON)
{
WeaponAttackType attType = damageInfo->GetAttackType();
Item* item = nullptr;
if (attType == BASE_ATTACK || attType == RANGED_ATTACK)
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
else if (attType == OFF_ATTACK)
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (!item || item->IsBroken() || item->GetTemplate()->GetClass() != ITEM_CLASS_WEAPON || !((1 << item->GetTemplate()->GetSubClass()) & GetSpellInfo()->EquippedItemSubClassMask))
if (target->ToPlayer()->IsInFeralForm())
return 0;
if (DamageInfo const* damageInfo = eventInfo.GetDamageInfo())
{
if (damageInfo->GetAttackType() != OFF_ATTACK)
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
else
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
}
}
}
else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR)
{
// Check if player is wearing shield
Item* item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (!item || item->IsBroken() || item->GetTemplate()->GetClass() != ITEM_CLASS_ARMOR || !((1 << item->GetTemplate()->GetSubClass()) & GetSpellInfo()->EquippedItemSubClassMask))
else if (GetSpellInfo()->EquippedItemClass == ITEM_CLASS_ARMOR)
{
// Check if player is wearing shield
item = target->ToPlayer()->GetUseableItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
}
if (!item || item->IsBroken() || !item->IsFitToSpellRequirements(GetSpellInfo()))
return 0;
}
}