aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2009-06-12 13:01:42 +0200
committerQAston <none@none>2009-06-12 13:01:42 +0200
commitbc7a381b6236f98369f23cf012565b3bb590618d (patch)
tree6bb9a536f5b46966c06607a65739ffd5251b8dd1
parentf7c50a6f01042e401e7dee664d140857d42b7fa5 (diff)
*Fix shadow bite bonus per dot on target.
--HG-- branch : trunk
-rw-r--r--src/game/SpellEffects.cpp11
-rw-r--r--src/game/Unit.cpp23
-rw-r--r--src/game/Unit.h1
3 files changed, 34 insertions, 1 deletions
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9b176683e7c..31d548c5254 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -474,7 +474,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage += int32(damage*0.25f);
}
// Conflagrate - consumes immolate
- if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
+ else if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
{
// Glyph of Conflagrate
if (m_caster->HasAura(56235))
@@ -491,6 +491,15 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
}
}
+ // Shadow Bite
+ else if (m_spellInfo->SpellFamilyFlags[1] & 0x400000)
+ {
+ if (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature *)m_caster)->isPet())
+ {
+ // Get DoTs on target by owner (5% increase by dot)
+ damage += 5 * unitTarget->GetDoTsByCaster(m_caster->GetOwnerGUID()) / 100;
+ }
+ }
break;
}
case SPELLFAMILY_PRIEST:
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index ed183277901..aa08549d336 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4422,6 +4422,29 @@ uint32 Unit::GetDiseasesByCaster(uint64 casterGUID) const
return diseases;
}
+uint32 Unit::GetDoTsByCaster(uint64 casterGUID) const
+{
+ static const AuraType diseaseAuraTypes[] =
+ {
+ SPELL_AURA_PERIODIC_DAMAGE,
+ SPELL_AURA_PERIODIC_DAMAGE_PERCENT,
+ SPELL_AURA_NONE
+ };
+
+ uint32 dots=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)
+ {
+ // Get auras by caster
+ if ((*i)->GetCasterGUID()==casterGUID)
+ ++dots;
+ }
+ }
+ return dots;
+}
+
void Unit::AddDynObject(DynamicObject* dynObj)
{
m_dynObjGUIDs.push_back(dynObj->GetGUID());
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 6f8b6990129..a9efdffcb9b 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1564,6 +1564,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool HasAuraType(AuraType auraType) const;
bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
uint32 GetDiseasesByCaster(uint64 casterGUID) const;
+ uint32 GetDoTsByCaster(uint64 casterGUID) const;
int32 GetTotalAuraModifier(AuraType auratype) const;
float GetTotalAuraMultiplier(AuraType auratype) const;