aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2018-01-18 16:08:24 -0300
committerShauren <shauren.trinity@gmail.com>2021-06-16 12:20:14 +0200
commitb27e741096b59d3e07503bb8db30df6596dee1f2 (patch)
tree97593a651ef4608e24ea24e6f80a597188cd7f59
parent62c571076e5319c07c7222e139dbfc7c8bb4543f (diff)
Core/Auras: define and implement attribute SPELL_ATTR3_NO_PROC_EQUIP_REQUIREMENT
Closes #20148 (cherry picked from commit 29c3b7d8f60c18e52ec22fec6de9abc3dc468166)
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp38
2 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index f94e0e3b00b..7603bef304d 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -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
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index bc964c8e55c..62c5454a251 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -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;
}
}