Jump to content

[Bug item] Althor's Abacus


Guest dardennf

Recommended Posts

Mangos Rev : 9632

How it should work : Each time your spells heal a target you have a chance to cause another nearby friendly target to be instantly healed for 5550 to 6450, internal Cooldown => 45 sec.

How it does work : No internal cooldown (can be fixed in Database) but there is no limitation of people who are healed.

Item : Althor's Abacus

Spell : Item - Icecrown 25 Normal Healer Trinket 2

Tempfix for ICD :

DELETE from spell_proc_event where entry = 71611;
INSERT INTO spell_proc_event VALUES
(71611, 0, 0, 0, 0, 0, 0, 0, 0, 0, 45);

Link to comment
Share on other sites

try this

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 555a44b..271a55c 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1304,6 +1304,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
                case 31347:                                 // Doom TODO: exclude top threat target from target selection
                case 33711:                                 // Murmur's Touch
                case 38794:                                 // Murmur's Touch (h)
+                case 71610:
                    unMaxTargets = 1;
                    break;
                case 28542:                                 // Life Drain

Link to comment
Share on other sites

sorry for the double post but i found a way that works though it might be a little hackish. For whatever reason the spell goes to implicit target 63 (TARGET_DUELVSPLAYER_COORDINATES) as well as implicit target 31 (TARGET_ALL_FRIENDLY_IN_AREA or something like that) and implicit target 23 (TARGET_GAMEOBJECT). I didn't deal with the gameobject one but this should fix it healing everyone (just chooses a random target near the original caster and heals it)

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index b0acd37..789d381 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1661,7 +1661,11 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
        }
        case TARGET_DUELVSPLAYER_COORDINATES:
        {
-            if(Unit* currentTarget = m_targets.getUnitTarget())
+            if(m_spellInfo->Id == 71610)
+            {
+                break;
+            }
+            else if(Unit* currentTarget = m_targets.getUnitTarget())
            {
                m_targets.setDestination(currentTarget->GetPositionX(), currentTarget->GetPositionY(), currentTarget->GetPositionZ());
                targetUnitMap.push_back(currentTarget);
@@ -1724,8 +1728,46 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
            }
            break;
        case TARGET_ALL_FRIENDLY_UNITS_IN_AREA:
+            // Echoes of Light
+            if (m_spellInfo->Id == 71610)
+            {
+                CellPair p(MaNGOS::ComputeCellPair(m_caster->GetPositionX(), m_caster->GetPositionY()));
+                Cell cell(p);
+                cell.data.Part.reserved = ALL_DISTRICT;
+                cell.SetNoCreate();
+                std::list<Unit*> tempTargetUnitMap;
+                {
+                    MaNGOS::AnyFriendlyUnitInObjectRangeCheck u_check(m_caster, radius);
+                    MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck> searcher(m_caster, tempTargetUnitMap, u_check);
+
+                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
+                    TypeContainerVisitor<MaNGOS::UnitListSearcher<MaNGOS::AnyFriendlyUnitInObjectRangeCheck>, GridTypeMapContainer >  grid_unit_searcher(searcher);
+
+                    cell.Visit(p, world_unit_searcher, *m_caster->GetMap(), *m_caster, radius);
+                    cell.Visit(p, grid_unit_searcher, *m_caster->GetMap(), *m_caster, radius);
+                }
+
+                if(tempTargetUnitMap.empty())
+                    break;
+
+                tempTargetUnitMap.sort(TargetDistanceOrder(m_caster));
+
+                //Now to get us a random target that's in the initial range of the spell
+                uint32 t = 0;
+                std::list<Unit*>::iterator itr = tempTargetUnitMap.begin();
+                while(itr != tempTargetUnitMap.end() && (*itr)->IsWithinDist(m_caster, radius))
+                    ++t, ++itr;
+
+                if(!t)
+                    break;
+
+                itr = tempTargetUnitMap.begin();
+                std::advance(itr, rand() % t);
+                Unit *pUnitTarget = *itr;
+                targetUnitMap.push_back(pUnitTarget);
+            }
            // Death Pact (in fact selection by player selection)
-            if (m_spellInfo->Id == 48743)
+            else if (m_spellInfo->Id == 48743)
            {
                // checked in Spell::CheckCast
                if (m_caster->GetTypeId()==TYPEID_PLAYER)

EDIT: Just to clarify, i checked the DBC files and it doesn't have implicitTarget 63. But for some reason it still goes to that case statement. It does have EffectMechanic 63 though i don't even know where the effect mechanics are listed.

Link to comment
Share on other sites

×
×
  • 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