diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 36 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 32 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 |
3 files changed, 36 insertions, 36 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index d774b62af5f..5990c70a2e9 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3625,8 +3625,8 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_DONT_REPORT; // only check at first call, Stealth auras are already removed at second call - // for now, ignore triggered spells - if( strict && !m_IsTriggeredSpell) + // for now, ignore triggered by aura spells + if( strict && !m_triggeredByAuraSpell) { bool checkForm = true; // Ignore form req aura @@ -5182,6 +5182,38 @@ SpellCastResult Spell::CheckItems() } } + // check weapon presence in slots for main/offhand weapons + if(m_spellInfo->EquippedItemClass >=0) + { + // main hand weapon required + if(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_MAIN_HAND) + { + Item* item = ((Player*)m_caster)->GetWeaponForAttack(BASE_ATTACK); + + // skip spell if no weapon in slot or broken + if(!item || item->IsBroken() ) + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; + + // skip spell if weapon not fit to triggered spell + if(!item->IsFitToSpellRequirements(m_spellInfo)) + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; + } + + // offhand hand weapon required + if(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND) + { + Item* item = ((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK); + + // skip spell if no weapon in slot or broken + if(!item || item->IsBroken() ) + return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + + // skip spell if weapon not fit to triggered spell + if(!item->IsFitToSpellRequirements(m_spellInfo)) + return m_IsTriggeredSpell ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + } + } + return SPELL_CAST_OK; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 9fd70cb676e..1cbd5f94772 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2101,38 +2101,6 @@ void Spell::EffectTriggerSpell(uint32 i) return; } - // some triggered spells require specific equipment - if(spellInfo->EquippedItemClass >=0 && m_caster->GetTypeId()==TYPEID_PLAYER) - { - // main hand weapon required - if(spellInfo->AttributesEx3 & SPELL_ATTR_EX3_MAIN_HAND) - { - Item* item = ((Player*)m_caster)->GetWeaponForAttack(BASE_ATTACK); - - // skip spell if no weapon in slot or broken - if(!item || item->IsBroken() ) - return; - - // skip spell if weapon not fit to triggered spell - if(!item->IsFitToSpellRequirements(spellInfo)) - return; - } - - // offhand hand weapon required - if(spellInfo->AttributesEx3 & SPELL_ATTR_EX3_REQ_OFFHAND) - { - Item* item = ((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK); - - // skip spell if no weapon in slot or broken - if(!item || item->IsBroken() ) - return; - - // skip spell if weapon not fit to triggered spell - if(!item->IsFitToSpellRequirements(spellInfo)) - return; - } - } - // some triggered spells must be casted instantly (for example, if next effect case instant kill caster) bool instant = false; for(uint32 j = i+1; j < 3; ++j) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 127623dfb6c..f2f824481ad 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -5986,7 +5986,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 32221; } else - return true; + return false; break; } // Seal of the Martyr do damage trigger @@ -6003,7 +6003,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 53718; } else - return true; + return false; break; } // Paladin Tier 6 Trinket (Ashtongue Talisman of Zeal) |