All pastes #884989 Raw Edit

MeanMachine

public diff v1 · immutable
#884989 ·published 2008-01-30 18:35 UTC
rendered paste body
Index: src/game/Spell.cpp===================================================================--- src/game/Spell.cpp	(revision 4919)+++ src/game/Spell.cpp	(working copy)@@ -736,23 +736,35 @@             // targets the ground, not the units in the area             if (m_spellInfo->Effect[i]!=SPELL_EFFECT_PERSISTENT_AREA_AURA)             {-                CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));+                WorldObject *ref = m_caster;++                //Special case for some AoE spells, was changed that way because of area damage caps+                if(m_triggeredByAura && m_spellInfo->EffectImplicitTargetA[i] == TARGET_SET_POINT)+                {+                    DynamicObject *point = m_caster->GetDynObject(m_triggeredByAura->GetId(), 0);+                    if(point)+                        ref = point;+                }++                CellPair p(MaNGOS::ComputeCellPair(ref->GetPositionX(), ref->GetPositionY()));                 Cell cell = RedZone::GetZone(p);                 cell.data.Part.reserved = ALL_DISTRICT;                 cell.SetNoCreate(); -                MaNGOS::SpellNotifierCreatureAndPlayer notifier(*this, TagUnitMap, radius, PUSH_DEST_CENTER,SPELL_TARGETS_AOE_DAMAGE);+                MaNGOS::AnyAoETargetUnitInObjectRangeCheck u_check(ref, m_caster, radius);+                MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck> searcher(TagUnitMap, u_check); -                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, WorldTypeMapContainer > world_object_notifier(notifier);-                TypeContainerVisitor<MaNGOS::SpellNotifierCreatureAndPlayer, GridTypeMapContainer >  grid_object_notifier(notifier);+                TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);+                TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);                  CellLock<GridReadGuard> cell_lock(cell, p);-                cell_lock->Visit(cell_lock, world_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));-                cell_lock->Visit(cell_lock, grid_object_notifier, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));+                cell_lock->Visit(cell_lock, world_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));+                cell_lock->Visit(cell_lock, grid_unit_searcher, *MapManager::Instance().GetMap(m_caster->GetMapId(), m_caster));             }         }break;         case TARGET_ALL_PARTY_AROUND_CASTER:         case TARGET_ALL_PARTY:+        case TARGET_ALL_PARTY_AROUND_CASTER_2:         {             Unit* owner = m_caster->GetCharmerOrOwner();             Group  *pGroup = NULL;Index: src/game/Spell.h===================================================================--- src/game/Spell.h	(revision 4919)+++ src/game/Spell.h	(working copy)@@ -82,6 +82,7 @@     TARGET_ALL_FRIENDLY_UNITS_AROUND_CASTER = 30,           // in TargetB used only with TARGET_ALL_AROUND_CASTER and in self casting range in TargetA     TARGET_MINION                      = 32,     TARGET_ALL_PARTY                   = 33,+    TARGET_ALL_PARTY_AROUND_CASTER_2   = 34,     TARGET_SINGLE_PARTY                = 35,     TARGET_AREAEFFECT_PARTY            = 37,     TARGET_SCRIPT                      = 38,@@ -96,6 +97,7 @@     TARGET_CURRENT_SELECTED_ENEMY      = 53,     TARGET_SINGLE_FRIEND_2             = 57,     TARGET_AREAEFFECT_PARTY_AND_CLASS  = 61,+    TARGET_SET_POINT                   = 76,                // used in AoE spells (Blizzard, Hurricane, etc.) where a peristent dummy aura marks the point.     TARGET_SINGLE_ENEMY                = 77, }; Index: src/game/SpellAuras.cpp===================================================================--- src/game/SpellAuras.cpp	(revision 4919)+++ src/game/SpellAuras.cpp	(working copy)@@ -1025,7 +1025,7 @@     uint32 trigger_spell_id = GetSpellProto()->EffectTriggerSpell[m_effIndex];     Unit* caster = GetCaster();     Unit* target = m_target;-    uint64 originalCasterGUID = 0;+    uint64 originalCasterGUID = GetCasterGUID();      // specific code for cases with no trigger spell provided in field     switch(GetId())@@ -1082,11 +1082,15 @@         }     } -    if(!trigger_spell_id)+    SpellEntry const *proto = sSpellStore.LookupEntry(trigger_spell_id);+    if(!proto)     {-        sLog.outError("Aura::TriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",GetSpellProto()->Id,GetEffIndex());+        sLog.outError("Aura::TriggerSpell: Unknown spell %u", trigger_spell_id);         return;     }+    +    if(proto->EffectImplicitTargetA[m_effIndex] == TARGET_SELF) //Specific check for target_self+        caster = target;                      if(!caster || !target)         return;