diff options
-rw-r--r-- | src/game/SpellEffects.cpp | 7 | ||||
-rw-r--r-- | src/game/Unit.cpp | 15 | ||||
-rw-r--r-- | src/game/Unit.h | 2 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 15bdaaeee21..aa4422e2718 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4309,6 +4309,13 @@ void Spell::SpellDamageWeaponDmg(uint32 i) } break; } + case SPELLFAMILY_DEATHKNIGHT: + { + // Obliterate (12.5% more damage per disease) + if (m_spellInfo->SpellFamilyFlags[1] & 0x20000) + totalDamagePercentMod *= (float(CalculateDamage(2, unitTarget) * unitTarget->GetDiseasesByCaster(m_caster->GetGUID(), true) / 2) + 100.0f) / 100.f; + break; + } } bool normalized = false; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a7fdab050e0..86638f14341 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4428,7 +4428,7 @@ AuraEffect* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint return NULL; } -uint32 Unit::GetDiseasesByCaster(uint64 casterGUID) const +uint32 Unit::GetDiseasesByCaster(uint64 casterGUID, bool remove) { static const AuraType diseaseAuraTypes[] = { @@ -4440,13 +4440,22 @@ uint32 Unit::GetDiseasesByCaster(uint64 casterGUID) const uint32 diseases=0; for(AuraType const* itr = &diseaseAuraTypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr) { - Unit::AuraEffectList const& auras = GetAurasByType(*itr); - for(AuraEffectList::const_iterator i = auras.begin();i != auras.end(); ++i) + for(AuraEffectList::iterator i = m_modAuras[*itr].begin();i != m_modAuras[*itr].end(); ) { // Get auras with disease dispel type by caster if ((*i)->GetSpellProto()->Dispel == DISPEL_DISEASE && (*i)->GetCasterGUID()==casterGUID) + { ++diseases; + + if (remove) + { + RemoveAura((*i)->GetId(), (*i)->GetCasterGUID()); + i = m_modAuras[*itr].begin(); + continue; + } + } + ++i; } } return diseases; diff --git a/src/game/Unit.h b/src/game/Unit.h index a0e6f1eecb6..011a2a9940f 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1570,7 +1570,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const; AuraEffect* GetDummyAura(uint32 spell_id) const; AuraEffect* GetDummyAura(SpellFamilyNames name, uint32 iconId) const; - uint32 GetDiseasesByCaster(uint64 casterGUID) const; + uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove = false); uint32 GetDoTsByCaster(uint64 casterGUID) const; int32 GetTotalAuraModifier(AuraType auratype) const; |