diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 82da3a640..f03675e3e 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -449,7 +449,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = { #define SPELL_ATTR_EX6_UNK26 0x04000000 // 26 not set in 3.0.3 #define SPELL_ATTR_EX6_UNK27 0x08000000 // 27 not set in 3.0.3 #define SPELL_ATTR_EX6_UNK28 0x10000000 // 28 not set in 3.0.3 -#define SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS 0x20000000 // 29 do not apply damage percent mods (usually in cases where it has already been applied) +#define SPELL_ATTR_EX6_NO_DMG_MODS 0x20000000 // 29 do not apply damage mods (usually in cases where it has already been applied) #define SPELL_ATTR_EX6_UNK30 0x40000000 // 30 not set in 3.0.3 #define SPELL_ATTR_EX6_UNK31 0x80000000 // 31 not set in 3.0.3 diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6a80cfe57..b1f62a91c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6107,7 +6107,7 @@ int32 Unit::SpellBonusWithCoeffs(SpellEntry const *spellProto, int32 total, int3 */ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack) { - if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE ) + if(!spellProto || !pVictim || damagetype==DIRECT_DAMAGE || spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS) return pdamage; // For totems get damage bonus from owner (statue isn't totem in fact) @@ -6124,19 +6124,16 @@ uint32 Unit::SpellDamageBonusDone(Unit *pVictim, SpellEntry const *spellProto, u if( GetTypeId() == TYPEID_UNIT && !((Creature*)this)->isPet() ) DoneTotalMod *= ((Creature*)this)->GetSpellDamageMod(((Creature*)this)->GetCreatureInfo()->rank); - if (!(spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_PERCENT_MODS)) + AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); + for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) { - AuraList const& mModDamagePercentDone = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - for(AuraList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i) + if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) && + (*i)->GetSpellProto()->EquippedItemClass == -1 && + // -1 == any item class (not wand then) + (*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 ) + // 0 == any inventory type (not wand then) { - if( ((*i)->GetModifier()->m_miscvalue & GetSpellSchoolMask(spellProto)) && - (*i)->GetSpellProto()->EquippedItemClass == -1 && - // -1 == any item class (not wand then) - (*i)->GetSpellProto()->EquippedItemInventoryTypeMask == 0 ) - // 0 == any inventory type (not wand then) - { - DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; - } + DoneTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; } } @@ -7087,10 +7084,7 @@ bool Unit::IsDamageToThreatSpell(SpellEntry const * spellInfo) const */ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType attType, SpellEntry const *spellProto, DamageEffectType damagetype, uint32 stack) { - if (!pVictim) - return pdamage; - - if (pdamage == 0) + if (!pVictim || pdamage == 0 || (spellProto && spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS)) return pdamage; // differentiate for weapon damage based spells diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9e08a10d1..2ea040046 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10530" + #define REVISION_NR "10531" #endif // __REVISION_NR_H__