aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2016-12-11 15:04:25 -0300
committerjoschiwald <joschiwald.trinity@gmail.com>2018-04-21 13:52:37 +0200
commit76831d16bea0a4fdf7e11656c69949fd706971f9 (patch)
tree53530b5caee70d3e9d44b4fc167c907f660e1231 /src/server/game/Spells/Spell.cpp
parent4aaf4245646e4f117cb2de7855b5672ce2fff14f (diff)
Core/Spell: implemented dispel reflection
Closes #18323 (cherry picked from commit f0772eea98c66f7fd2e745c0cfb8599d6c21ef19) # Conflicts: # src/server/game/Spells/Spell.cpp # src/server/game/Spells/Spell.h # src/server/game/Spells/SpellEffects.cpp
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 5ce5123f762..245b2a64ac7 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -581,6 +581,7 @@ m_spellValue(new SpellValue(caster->GetMap()->GetDifficultyID(), m_spellInfo))
gameObjTarget = NULL;
destTarget = NULL;
damage = 0;
+ targetMissInfo = SPELL_MISS_NONE;
variance = 0.0f;
effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH;
effectInfo = nullptr;
@@ -611,7 +612,7 @@ m_spellValue(new SpellValue(caster->GetMap()->GetDifficultyID(), m_spellInfo))
// Patch 1.2 notes: Spell Reflection no longer reflects abilities
m_canReflect = m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && !m_spellInfo->HasAttribute(SPELL_ATTR0_ABILITY)
&& !m_spellInfo->HasAttribute(SPELL_ATTR1_CANT_BE_REFLECTED) && !m_spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY)
- && !m_spellInfo->IsPassive() && !m_spellInfo->IsPositive();
+ && !m_spellInfo->IsPassive();
CleanupTargetList();
@@ -2160,7 +2161,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
// Calculate hit result
if (m_originalCaster)
{
- targetInfo.missCondition = m_originalCaster->SpellHitResult(target, m_spellInfo, m_canReflect);
+ targetInfo.missCondition = m_originalCaster->SpellHitResult(target, m_spellInfo, m_canReflect && !(m_spellInfo->IsPositive() && m_caster->IsFriendlyTo(target)));
if (m_skipCheck && targetInfo.missCondition != SPELL_MISS_IMMUNE)
targetInfo.missCondition = SPELL_MISS_NONE;
}
@@ -2358,6 +2359,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// Need init unitTarget by default unit (can changed in code on reflect)
// Or on missInfo != SPELL_MISS_NONE unitTarget undefined (but need in trigger subsystem)
unitTarget = unit;
+ targetMissInfo = missInfo;
// Reset damage/healing counter
m_damage = target->damage;