Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
- index 3e6e790..3ecb4b8 100644
- --- a/src/game/Spell.cpp
- +++ b/src/game/Spell.cpp
- @@ -1949,6 +1950,29 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
- FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 1, true, false, true);
- else if (m_spellInfo->Id == 54171) // Divine Storm
- FillRaidOrPartyHealthPriorityTargets(targetUnitMap, m_caster, m_caster, radius, 3, true, false, true);
- + else if (m_spellInfo->Id == 59725) // Improved Spell Reflection
- + {
- + if (m_caster->HasAura(23920, EFFECT_INDEX_0) )
- + m_caster->RemoveAurasDueToSpell(23920); // will be replaced by imp. spell refl. aura
- +
- + Unit::AuraList const& lDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
- + for(Unit::AuraList::const_iterator i = lDummyAuras.begin(); i != lDummyAuras.end(); ++i)
- + {
- + if((*i)->GetSpellProto()->SpellIconID == 1935)
- + {
- + unMaxTargets = (*i)->GetModifier()->m_amount + 1; // +1 because we are also applying this to the caster
- + break;
- + }
- + }
- +
- + radius = 20.0f; // as mentioned in the spell's tooltip (data doesn't appear in dbc)
- +
- + FillRaidOrPartyTargets(targetUnitMap, m_caster, m_caster, radius, false, false, true);
- + targetUnitMap.sort(TargetDistanceOrder(m_caster));
- + if (targetUnitMap.size() > unMaxTargets)
- + targetUnitMap.resize(unMaxTargets);
- + break;
- + }
- else
- FillRaidOrPartyTargets(targetUnitMap, m_caster, m_caster, radius, true, true, true);
- break;
- diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
- index 17d4e5f..aace413 100644
- --- a/src/game/SpellAuras.cpp
- +++ b/src/game/SpellAuras.cpp
- @@ -78,7 +78,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
- &Aura::HandleAuraModPacify, // 25 SPELL_AURA_MOD_PACIFY
- &Aura::HandleAuraModRoot, // 26 SPELL_AURA_MOD_ROOT
- &Aura::HandleAuraModSilence, // 27 SPELL_AURA_MOD_SILENCE
- - &Aura::HandleNoImmediateEffect, // 28 SPELL_AURA_REFLECT_SPELLS implement in Unit::SpellHitResult
- + &Aura::HandleAuraModReflectSpells, // 28 SPELL_AURA_REFLECT_SPELLS actual reflecting implemented in Unit::SpellHitResult
- &Aura::HandleAuraModStat, // 29 SPELL_AURA_MOD_STAT
- &Aura::HandleAuraModSkill, // 30 SPELL_AURA_MOD_SKILL
- &Aura::HandleAuraModIncreaseSpeed, // 31 SPELL_AURA_MOD_INCREASE_SPEED
- @@ -4726,6 +4752,41 @@ void Aura::HandleAuraModSilence(bool apply, bool Real)
- }
- }
- +void Aura::HandleAuraModReflectSpells(bool Apply, bool Real)
- +{
- + if (!Real)
- + return;
- +
- + Unit* target = GetTarget();
- + Unit* caster = GetCaster();
- +
- + if (Apply)
- + {
- + switch(GetId() )
- + {
- + // Improved Spell Reflection
- + case 23920:
- + {
- + if (!caster)
- + return;
- +
- + Unit::AuraList const& lDummyAuras = caster->GetAurasByType(SPELL_AURA_DUMMY);
- + for(Unit::AuraList::const_iterator i = lDummyAuras.begin(); i != lDummyAuras.end(); ++i)
- + {
- + if((*i)->GetSpellProto()->SpellIconID == 1935)
- + {
- + caster->CastSpell(caster, 59725, true);
- + break;
- + }
- + }
- + break;
- + }
- + default:
- + break;
- + }
- + }
- +}
- +
- void Aura::HandleModThreat(bool apply, bool Real)
- {
- // only at real add/remove aura
- diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
- index ead9977..cf334a9 100644
- --- a/src/game/SpellAuras.h
- +++ b/src/game/SpellAuras.h
- @@ -119,6 +119,7 @@ class MANGOS_DLL_SPEC Aura
- void HandleAuraModResistance(bool Apply, bool Real);
- void HandleAuraModRoot(bool Apply, bool Real);
- void HandleAuraModSilence(bool Apply, bool Real);
- + void HandleAuraModReflectSpells(bool Apply, bool Real);
- void HandleAuraModStat(bool Apply, bool Real);
- void HandleAuraModIncreaseSpeed(bool Apply, bool Real);
- void HandleAuraModIncreaseMountedSpeed(bool Apply, bool Real);
- diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
- index d56e6de..6d953c2 100644
- --- a/src/game/Unit.cpp
- +++ b/src/game/Unit.cpp
- @@ -13259,6 +13259,16 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
- removedSpells.push_back(triggeredByAura->GetId());
- }
- + // If reflecting with Imp. Spell Reflection - we must also remove auras from the remaining aura's targets
- + if (triggeredByAura->GetId() == 59725)
- + if (Unit* pImpSRCaster = triggeredByAura->GetCaster() )
- + if (Group* group = ((Player*)pImpSRCaster)->GetGroup())
- + for(GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
- + if (Player* member = itr->getSource())
- + if (Aura* pAura = member->GetAura(59725, EFFECT_INDEX_0) )
- + if (pAura->GetCaster() == pImpSRCaster)
- + member->RemoveAura(pAura);
- +
- triggeredByAura->SetInUse(false);
- }
- if (!removedSpells.empty())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement