aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-03-19 08:47:03 +0100
committerthenecromancer <none@none>2010-03-19 08:47:03 +0100
commit34d7e1fed941c03674147e8b84a0f30548f614b8 (patch)
tree6b1f2811396aad51c4381c91926cb9396758b1a6 /src
parentf1266ebec3cec67e8f6af569018dd428149b0063 (diff)
Missing part of previous commit (Periodic Leech is DoT as well)
Fix talents Improved Rend and Gag Order not increasing whole damage of affected spells (applying effect modifiers - spellmod_effectx should be however done for every static damage added to already calculated damage, we can't just apply all spellmods after effects are processed...) --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuraEffects.cpp5
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/Unit.cpp38
-rw-r--r--src/game/Unit.h1
4 files changed, 28 insertions, 18 deletions
diff --git a/src/game/SpellAuraEffects.cpp b/src/game/SpellAuraEffects.cpp
index f3e607537c7..ce72b8d899b 100644
--- a/src/game/SpellAuraEffects.cpp
+++ b/src/game/SpellAuraEffects.cpp
@@ -588,7 +588,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
int32 mws = caster->GetAttackTime(BASE_ATTACK);
float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE);
float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE);
- amount+=int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f);
+ amount+=caster->ApplyEffectModifiers(m_spellProto,m_effIndex,int32(((mwb_min+mwb_max)/2+ap*mws/14000)*0.2f));
// "If used while your target is above 75% health, Rend does 35% more damage."
// as for 3.1.3 only ranks above 9 (wrong tooltip?)
if (spellmgr.GetSpellRank(m_spellProto->Id) >= 9)
@@ -1333,7 +1333,10 @@ void AuraEffect::PeriodicTick(Unit * target, Unit * caster) const
bool crit = IsPeriodicTickCrit(target, caster);
if (crit)
+ {
damage = caster->SpellCriticalDamageBonus(m_spellProto, damage, target);
+ damage -= target->GetSpellCritDamageReduction(damage);
+ }
//Calculate armor mitigation if it is a physical spell
if (GetSpellSchoolMask(GetSpellProto()) & SPELL_SCHOOL_MASK_NORMAL)
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index b849f13c5a1..147f8dddc9e 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -438,7 +438,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage = uint32(damage * (m_caster->GetTotalAttackPowerValue(BASE_ATTACK)) / 100);
// Shield Slam
else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
- damage += int32(m_caster->GetShieldBlockValue());
+ damage += m_caster->ApplyEffectModifiers(m_spellInfo,effect_idx,int32(m_caster->GetShieldBlockValue()));
// Victory Rush
else if (m_spellInfo->SpellFamilyFlags[1] & 0x100)
{
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5a07c68efe4..8608daa55fc 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12212,6 +12212,27 @@ Unit* Creature::SelectVictim()
//======================================================================
//======================================================================
+int32 Unit::ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value)
+{
+ if (Player* modOwner = GetSpellModOwner())
+ {
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_ALL_EFFECTS, value);
+ switch (effect_index)
+ {
+ case 0:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT1, value);
+ break;
+ case 1:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT2, value);
+ break;
+ case 2:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT3, value);
+ break;
+ }
+ }
+ return value;
+}
+
int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 effBasePoints, Unit const* /*target*/)
{
int32 level = int32(getLevel());
@@ -12239,22 +12260,7 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
if (float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index])
value += int32(comboDamage * comboPoints);
- if (Player* modOwner = GetSpellModOwner())
- {
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_ALL_EFFECTS, value);
- switch (effect_index)
- {
- case 0:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT1, value);
- break;
- case 1:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT2, value);
- break;
- case 2:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT3, value);
- break;
- }
- }
+ value = ApplyEffectModifiers(spellProto, effect_index, value);
if (!basePointsPerLevel && (spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel) &&
spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE &&
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 67c45ad3605..d98c9730049 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1838,6 +1838,7 @@ class Unit : public WorldObject
void SetHover(bool on);
bool isHover() const { return HasAuraType(SPELL_AURA_HOVER); }
+ int32 ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value);
int32 CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 basePoints, Unit const* target);
int32 CalcSpellDuration(SpellEntry const* spellProto);
int32 ModSpellDuration(SpellEntry const* spellProto, Unit const* target, int32 duration, bool positive);