diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 1234c5abe2..dc8edf88d4 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -416,7 +416,7 @@ enum SpellAttr1 SPELL_ATTR1_IS_FISHING = 0x01000000, // 24 only fishing spells SPELL_ATTR1_UNK25 = 0x02000000, // 25 SPELL_ATTR1_UNK26 = 0x04000000, // 26 works correctly with [target=focus] and [target=mouseover] macros? - SPELL_ATTR1_UNK27 = 0x08000000, // 27 melee spell? + SPELL_ATTR1_DISCOUNT_POWER_ON_MISS = 0x08000000, // 27 Discount Power On Miss SPELL_ATTR1_DONT_DISPLAY_IN_AURA_BAR = 0x10000000, // 28 client doesn't display these spells in aura bar SPELL_ATTR1_CHANNEL_DISPLAY_SPELL_NAME = 0x20000000, // 29 spell name is displayed in cast bar instead of 'channeling' text SPELL_ATTR1_ENABLE_AT_DODGE = 0x40000000, // 30 Overpower diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index c27b2a7c19..cfd5aadeff 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5061,25 +5061,22 @@ void Spell::TakePower() Powers powerType = Powers(m_spellInfo->PowerType); bool hit = true; - if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->HasAttribute(SPELL_ATTR1_DISCOUNT_POWER_ON_MISS)) { - if (powerType == POWER_RAGE || powerType == POWER_ENERGY || powerType == POWER_RUNE) + if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID()) { - if (ObjectGuid targetGUID = m_targets.GetUnitTargetGUID()) + for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) { - for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + if (ihit->targetGUID == targetGUID) { - if (ihit->targetGUID == targetGUID) + if (ihit->missCondition != SPELL_MISS_NONE) { - if (ihit->missCondition != SPELL_MISS_NONE) - { - hit = false; - //lower spell cost on fail (by talent aura) - if (Player* modOwner = m_caster->ToPlayer()->GetSpellModOwner()) - modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost); - } - break; + hit = false; + //lower spell cost on fail (by talent aura) + if (Player* modOwner = m_caster->ToPlayer()->GetSpellModOwner()) + modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_SPELL_COST_REFUND_ON_FAIL, m_powerCost); } + break; } } }