aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortobmaps <spambot42@yandex.ru>2011-08-20 03:06:15 +0700
committertobmaps <spambot42@yandex.ru>2011-08-20 03:06:15 +0700
commite1e91bacbe08f1f4042ee07b93c7929f9479ac35 (patch)
tree7ddf99edc042c34612d67b5546dc0b4ecb92b6d5 /src
parentf94bd733e3226b790e869691e3bf5d7a920628bb (diff)
Core/Spells: Prevent apply spell power coefficients at bonus given by some "taken" damage mods
Closes #1991
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp11
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp24
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp13
3 files changed, 23 insertions, 25 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 5008f4a347e..3f44d413250 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -10855,16 +10855,16 @@ uint32 Unit::SpellDamageBonus(Unit* victim, SpellInfo const* spellProto, uint32
coeff = DotFactor;
}
- float coeff2 = CalculateLevelPenalty(spellProto) * stack;
- if (spellProto->SpellFamilyName) // TODO: fix this
- TakenTotal+= int32(TakenAdvertisedBenefit * coeff * coeff2);
+ float factorMod = CalculateLevelPenalty(spellProto) * stack;
+ // level penalty still applied on Taken bonus - is it blizzlike?
+ TakenTotal+= int32(TakenAdvertisedBenefit * factorMod);
if (Player* modOwner = GetSpellModOwner())
{
coeff *= 100.0f;
modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_BONUS_MULTIPLIER, coeff);
coeff /= 100.0f;
}
- DoneTotal += int32(DoneAdvertisedBenefit * coeff * coeff2);
+ DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
// Some spells don't benefit from done mods
@@ -11414,7 +11414,8 @@ uint32 Unit::SpellHealingBonus(Unit* victim, SpellInfo const* spellProto, uint32
}
factorMod *= CalculateLevelPenalty(spellProto) * stack;
- TakenTotal += int32(TakenAdvertisedBenefit * coeff * factorMod);
+ // level penalty still applied on Taken bonus - is it blizzlike?
+ TakenTotal += int32(TakenAdvertisedBenefit * factorMod);
if (Player* modOwner = GetSpellModOwner())
{
coeff *= 100.0f;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 158a4d8c2eb..fae4d83e312 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -4924,6 +4924,18 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
caster->CastSpell(target, GetAmount(), true);
}
break;
+ case SPELLFAMILY_PRIEST:
+ // Vampiric Touch
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
+ {
+ if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
+ {
+ int32 damage = aurEff->GetAmount() * 8;
+ // backfire damage
+ target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ }
+ }
+ break;
case SPELLFAMILY_WARLOCK:
// Haunt
if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
@@ -4952,18 +4964,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
}
break;
- case SPELLFAMILY_PRIEST:
- // Vampiric Touch
- if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
- {
- if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
- {
- int32 damage = aurEff->GetAmount() * 8;
- // backfire damage
- target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
- }
- }
- break;
case SPELLFAMILY_HUNTER:
// Misdirection
if (GetId() == 34477)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 3ef5d0d4777..c602a071c23 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1230,7 +1230,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
break;
}
}
- switch(m_spellInfo->DmgClass)
+ switch (m_spellInfo->DmgClass)
{
case SPELL_DAMAGE_CLASS_MAGIC:
if (positive)
@@ -1311,7 +1311,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
// Haunt
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1))
{
- AuraEffect * aurEff = m_spellAura->GetEffect(1);
+ AuraEffect* aurEff = m_spellAura->GetEffect(1);
aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
}
}
@@ -1358,18 +1358,15 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
}
- if (m_caster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)
+ if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)
m_caster->ToCreature()->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
// Needs to be called after dealing damage/healing to not remove breaking on damage auras
DoTriggersOnSpellHit(spellHitTarget, mask);
// if target is fallged for pvp also flag caster if a player
- if (unit->IsPvP())
- {
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
+ if (unit->IsPvP() && m_caster->GetTypeId() == TYPEID_PLAYER)
m_caster->ToPlayer()->UpdatePvP(true);
- }
CallScriptAfterHitHandlers();
}
@@ -1450,7 +1447,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
uint8 aura_effmask = 0;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- if (effectMask & (1 << i ) && m_spellInfo->Effects[i].IsUnitOwnedAuraEffect())
+ if (effectMask & (1 << i) && m_spellInfo->Effects[i].IsUnitOwnedAuraEffect())
aura_effmask |= 1 << i;
if (aura_effmask)