Jump to content

[patch]Razorpine's Fear Effect[51343]


Guest virusav

Recommended Posts

Spell 51343 should not be cast on players and their pets, only to hostile NPC:

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index c59658e..6ae146a 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1789,15 +1789,32 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
            break;
        case TARGET_AREAEFFECT_INSTANT:
        {
-            SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
-            // Select friendly targets for positive effect
-            if (IsPositiveEffect(m_spellInfo->Id, effIndex))
-                targetB = SPELL_TARGETS_FRIENDLY;
+            // Razorpine's Fear Effect
+            if (m_spellInfo->Id == 51343)
+            {
+                targetUnitMap.clear();
+                std::list<Creature*> tempTargetUnitMap;
+                MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, radius);
+                MaNGOS::CreatureListSearcher<MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck> searcher(tempTargetUnitMap, u_check);
+                Cell::VisitAllObjects(m_caster, searcher, radius);
+                for(std::list<Creature*>::iterator iter = tempTargetUnitMap.begin(); iter != tempTargetUnitMap.end(); ++iter)
+                {
+                    if (!((*iter)->IsPet() && (*iter)->GetOwner()->GetTypeId() == TYPEID_PLAYER))
+                        targetUnitMap.push_back((*iter));
+                }
+            }
+            else
+            {
+                SpellTargets targetB = SPELL_TARGETS_AOE_DAMAGE;
+                // Select friendly targets for positive effect
+                if (IsPositiveEffect(m_spellInfo->Id, effIndex))
+                    targetB = SPELL_TARGETS_FRIENDLY;

-            FillAreaTargets(targetUnitMap, m_caster->GetPositionX(), m_caster->GetPositionY(), radius, PUSH_DEST_CENTER, targetB);
+                FillAreaTargets(targetUnitMap, m_caster->GetPositionX(), m_caster->GetPositionY(), radius, PUSH_DEST_CENTER, targetB);

-            // exclude caster
-            targetUnitMap.remove(m_caster);
+                // exclude caster
+                targetUnitMap.remove(m_caster);
+            }
            break;
        }
        case TARGET_AREAEFFECT_CUSTOM: 

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use