Jump to content

[fix] demonic circle


Auntie Mangos

Recommended Posts

please take a look of this patch, i have been testing since 83xx and it works!

http://getmangos.eu/community/viewtopic.php?id=8644&highlight=demonic+circle

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index da6f652..5b66b7e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -571,6 +571,9 @@ void Spell::FillTargetMap()
                    break;
                }
                break;
+            case TARGET_AREAEFFECT_CUSTOM:
+                // We MUST select custom target. May be some SetCustomTargetMap(i, tmpUnitMap)
+                break;
            default:
                switch(m_spellInfo->EffectImplicitTargetB[i])
                {
@@ -1447,6 +1450,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
        case TARGET_AREAEFFECT_CUSTOM:
        case TARGET_AREAEFFECT_CUSTOM_2:
        case TARGET_SUMMON:
+        case TARGET_EFFECT_SELECT:
            TagUnitMap.push_back(m_caster);
            break;
        case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
@@ -3731,7 +3735,9 @@ SpellCastResult Spell::CheckCast(bool strict)
        return SPELL_FAILED_CASTER_AURASTATE;

    // Caster aura req check if need
-    if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
+    if(m_spellInfo->casterAuraSpell &&
+        sSpellStore.LookupEntry(m_spellInfo->casterAuraSpell) &&
+        !m_caster->HasAura(m_spellInfo->casterAuraSpell))
        return SPELL_FAILED_CASTER_AURASTATE;
    if(m_spellInfo->excludeCasterAuraSpell)
    {
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2dd62f9..51253d6 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1147,6 +1147,38 @@ void Aura::_RemoveAura()
    return true;
}

+void Aura::SendFakeAuraUpdate(uint32 auraId, bool remove)
+{
+    WorldPacket data(SMSG_AURA_UPDATE);
+    data.append(m_target->GetPackGUID());
+    data << uint8(64);
+    data << uint32(remove ? 0 : auraId);
+
+    if(remove)
+    {
+        m_target->SendMessageToSet(&data, true);
+        return;
+    }
+
+    uint8 auraFlags = GetAuraFlags();
+    data << uint8(auraFlags);
+    data << uint8(GetAuraLevel());
+    data << uint8(m_procCharges ? m_procCharges : m_stackAmount);
+
+    if(!(auraFlags & AFLAG_NOT_CASTER))
+    {
+        data << uint8(0);                                   // pguid
+    }
+
+    if(auraFlags & AFLAG_DURATION)
+    {
+        data << uint32(GetAuraMaxDuration());
+        data << uint32(GetAuraDuration());
+    }
+
+    m_target->SendMessageToSet(&data, true);
+}
+
void Aura::SendAuraUpdate(bool remove)
{
    WorldPacket data(SMSG_AURA_UPDATE);
@@ -4062,6 +4094,18 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)

    m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,misc,apply);

+    // Demonic Circle
+    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && GetSpellProto()->SpellIconID == 3221)
+    {
+        if (m_target->GetTypeId() != TYPEID_PLAYER)
+            return;
+        if (apply)
+        {
+            GameObject* obj = m_target->GetGameObject(48018);
+            if (obj)
+                ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation());
+        }
+    }
    // Bestial Wrath
    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->SpellIconID == 1680)
    {
@@ -4282,6 +4326,21 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+        {
+            switch (spell->Id)
+            {
+                case 48018:
+                    if (apply)
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                    {
+                        m_target->RemoveGameObject(spell->Id,true);
+                        SendFakeAuraUpdate(62388,true);
+                    }
+                break;
+            }
+        }
        case SPELLFAMILY_HUNTER:
        {
            // Explosive Shot
@@ -6747,6 +6806,20 @@ void Aura::PeriodicDummyTick()
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+            switch (spell->Id)
+            {
+                case 48018:
+                    GameObject* obj = m_target->GetGameObject(spell->Id);
+                    if (!obj) return;
+                    // We must take a range of teleport spell, not summon.
+                    const SpellEntry* goToCircleSpell = sSpellStore.LookupEntry(48020);
+                    if (m_target->IsWithinDist(obj,GetSpellMaxRange(sSpellRangeStore.LookupEntry(goToCircleSpell->rangeIndex))))
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                        SendFakeAuraUpdate(62388,true);
+            }
+            break;
        case SPELLFAMILY_ROGUE:
        {
            switch (spell->Id)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index a691c75..536cf2e 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -274,6 +274,7 @@ class MANGOS_DLL_SPEC Aura

        void SetAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? 0 : GetId()); }
        void SendAuraUpdate(bool remove);
+        void SendFakeAuraUpdate(uint32 auraId, bool remove);

        int8 GetStackAmount() {return m_stackAmount;}
        void SetStackAmount(uint8 num);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c1cfd68..f606453 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5814,7 +5814,7 @@ void Spell::EffectSummonObject(uint32 i)
    if(uint64 guid = m_caster->m_ObjectSlot[slot])
    {
        if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL)
-            obj->SetLootState(GO_JUST_DEACTIVATED);
+            if(obj) m_caster->RemoveGameObject(obj,true);
        m_caster->m_ObjectSlot[slot] = 0;
    }

download patch ----> http://omploader.org/vMjRqeA

author--->The Cman

edit: i think is the same patch -.-, sorry

Link to comment
Share on other sites

  • Replies 83
  • Created
  • Last Reply

Top Posters In This Topic

please take a look of this patch, i have been testing since 83xx and it works!

http://getmangos.eu/community/viewtopic.php?id=8644&highlight=demonic+circle

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index da6f652..5b66b7e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -571,6 +571,9 @@ void Spell::FillTargetMap()
                    break;
                }
                break;
+            case TARGET_AREAEFFECT_CUSTOM:
+                // We MUST select custom target. May be some SetCustomTargetMap(i, tmpUnitMap)
+                break;
            default:
                switch(m_spellInfo->EffectImplicitTargetB[i])
                {
@@ -1447,6 +1450,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
        case TARGET_AREAEFFECT_CUSTOM:
        case TARGET_AREAEFFECT_CUSTOM_2:
        case TARGET_SUMMON:
+        case TARGET_EFFECT_SELECT:
            TagUnitMap.push_back(m_caster);
            break;
        case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
@@ -3731,7 +3735,9 @@ SpellCastResult Spell::CheckCast(bool strict)
        return SPELL_FAILED_CASTER_AURASTATE;

    // Caster aura req check if need
-    if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
+    if(m_spellInfo->casterAuraSpell &&
+        sSpellStore.LookupEntry(m_spellInfo->casterAuraSpell) &&
+        !m_caster->HasAura(m_spellInfo->casterAuraSpell))
        return SPELL_FAILED_CASTER_AURASTATE;
    if(m_spellInfo->excludeCasterAuraSpell)
    {
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2dd62f9..51253d6 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1147,6 +1147,38 @@ void Aura::_RemoveAura()
    return true;
}

+void Aura::SendFakeAuraUpdate(uint32 auraId, bool remove)
+{
+    WorldPacket data(SMSG_AURA_UPDATE);
+    data.append(m_target->GetPackGUID());
+    data << uint8(64);
+    data << uint32(remove ? 0 : auraId);
+
+    if(remove)
+    {
+        m_target->SendMessageToSet(&data, true);
+        return;
+    }
+
+    uint8 auraFlags = GetAuraFlags();
+    data << uint8(auraFlags);
+    data << uint8(GetAuraLevel());
+    data << uint8(m_procCharges ? m_procCharges : m_stackAmount);
+
+    if(!(auraFlags & AFLAG_NOT_CASTER))
+    {
+        data << uint8(0);                                   // pguid
+    }
+
+    if(auraFlags & AFLAG_DURATION)
+    {
+        data << uint32(GetAuraMaxDuration());
+        data << uint32(GetAuraDuration());
+    }
+
+    m_target->SendMessageToSet(&data, true);
+}
+
void Aura::SendAuraUpdate(bool remove)
{
    WorldPacket data(SMSG_AURA_UPDATE);
@@ -4062,6 +4094,18 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)

    m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,misc,apply);

+    // Demonic Circle
+    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && GetSpellProto()->SpellIconID == 3221)
+    {
+        if (m_target->GetTypeId() != TYPEID_PLAYER)
+            return;
+        if (apply)
+        {
+            GameObject* obj = m_target->GetGameObject(48018);
+            if (obj)
+                ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation());
+        }
+    }
    // Bestial Wrath
    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->SpellIconID == 1680)
    {
@@ -4282,6 +4326,21 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+        {
+            switch (spell->Id)
+            {
+                case 48018:
+                    if (apply)
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                    {
+                        m_target->RemoveGameObject(spell->Id,true);
+                        SendFakeAuraUpdate(62388,true);
+                    }
+                break;
+            }
+        }
        case SPELLFAMILY_HUNTER:
        {
            // Explosive Shot
@@ -6747,6 +6806,20 @@ void Aura::PeriodicDummyTick()
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+            switch (spell->Id)
+            {
+                case 48018:
+                    GameObject* obj = m_target->GetGameObject(spell->Id);
+                    if (!obj) return;
+                    // We must take a range of teleport spell, not summon.
+                    const SpellEntry* goToCircleSpell = sSpellStore.LookupEntry(48020);
+                    if (m_target->IsWithinDist(obj,GetSpellMaxRange(sSpellRangeStore.LookupEntry(goToCircleSpell->rangeIndex))))
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                        SendFakeAuraUpdate(62388,true);
+            }
+            break;
        case SPELLFAMILY_ROGUE:
        {
            switch (spell->Id)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index a691c75..536cf2e 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -274,6 +274,7 @@ class MANGOS_DLL_SPEC Aura

        void SetAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? 0 : GetId()); }
        void SendAuraUpdate(bool remove);
+        void SendFakeAuraUpdate(uint32 auraId, bool remove);

        int8 GetStackAmount() {return m_stackAmount;}
        void SetStackAmount(uint8 num);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c1cfd68..f606453 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5814,7 +5814,7 @@ void Spell::EffectSummonObject(uint32 i)
    if(uint64 guid = m_caster->m_ObjectSlot[slot])
    {
        if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL)
-            obj->SetLootState(GO_JUST_DEACTIVATED);
+            if(obj) m_caster->RemoveGameObject(obj,true);
        m_caster->m_ObjectSlot[slot] = 0;
    }

download patch ----> http://omploader.org/vMjRqeA

author--->The Cman

edit: i think is the same patch -.-, sorry

ou nice thank you, this works;)

Link to comment
Share on other sites

  • 39 years later...

What bug does the patch fix? What features does the patch add?

warlock's Demonic Circle

For which repository revision was the patch created?

works on 8360

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

--

Who has been writing this patch? Please include either forum user names or email addresses.

dont really remember the guys name, it might be TortoiseUDiff, not sure

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index da6f652..5b66b7e 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -571,6 +571,9 @@ void Spell::FillTargetMap()
                    break;
                }
                break;
+            case TARGET_AREAEFFECT_CUSTOM:
+                // We MUST select custom target. May be some SetCustomTargetMap(i, tmpUnitMap)
+                break;
            default:
                switch(m_spellInfo->EffectImplicitTargetB[i])
                {
@@ -1447,6 +1450,7 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,UnitList& TagUnitMap)
        case TARGET_AREAEFFECT_CUSTOM:
        case TARGET_AREAEFFECT_CUSTOM_2:
        case TARGET_SUMMON:
+        case TARGET_EFFECT_SELECT:
            TagUnitMap.push_back(m_caster);
            break;
        case TARGET_RANDOM_ENEMY_CHAIN_IN_AREA:
@@ -3731,7 +3735,9 @@ SpellCastResult Spell::CheckCast(bool strict)
        return SPELL_FAILED_CASTER_AURASTATE;

    // Caster aura req check if need
-    if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
+    if(m_spellInfo->casterAuraSpell &&
+        sSpellStore.LookupEntry(m_spellInfo->casterAuraSpell) &&
+        !m_caster->HasAura(m_spellInfo->casterAuraSpell))
        return SPELL_FAILED_CASTER_AURASTATE;
    if(m_spellInfo->excludeCasterAuraSpell)
    {
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2dd62f9..51253d6 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1147,6 +1147,38 @@ void Aura::_RemoveAura()
    return true;
}

+void Aura::SendFakeAuraUpdate(uint32 auraId, bool remove)
+{
+    WorldPacket data(SMSG_AURA_UPDATE);
+    data.append(m_target->GetPackGUID());
+    data << uint8(64);
+    data << uint32(remove ? 0 : auraId);
+
+    if(remove)
+    {
+        m_target->SendMessageToSet(&data, true);
+        return;
+    }
+
+    uint8 auraFlags = GetAuraFlags();
+    data << uint8(auraFlags);
+    data << uint8(GetAuraLevel());
+    data << uint8(m_procCharges ? m_procCharges : m_stackAmount);
+
+    if(!(auraFlags & AFLAG_NOT_CASTER))
+    {
+        data << uint8(0);                                   // pguid
+    }
+
+    if(auraFlags & AFLAG_DURATION)
+    {
+        data << uint32(GetAuraMaxDuration());
+        data << uint32(GetAuraDuration());
+    }
+
+    m_target->SendMessageToSet(&data, true);
+}
+
void Aura::SendAuraUpdate(bool remove)
{
    WorldPacket data(SMSG_AURA_UPDATE);
@@ -4062,6 +4094,18 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)

    m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,misc,apply);

+    // Demonic Circle
+    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && GetSpellProto()->SpellIconID == 3221)
+    {
+        if (m_target->GetTypeId() != TYPEID_PLAYER)
+            return;
+        if (apply)
+        {
+            GameObject* obj = m_target->GetGameObject(48018);
+            if (obj)
+                ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation());
+        }
+    }
    // Bestial Wrath
    if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_HUNTER && GetSpellProto()->SpellIconID == 1680)
    {
@@ -4282,6 +4326,21 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+        {
+            switch (spell->Id)
+            {
+                case 48018:
+                    if (apply)
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                    {
+                        m_target->RemoveGameObject(spell->Id,true);
+                        SendFakeAuraUpdate(62388,true);
+                    }
+                break;
+            }
+        }
        case SPELLFAMILY_HUNTER:
        {
            // Explosive Shot
@@ -6747,6 +6806,20 @@ void Aura::PeriodicDummyTick()
            }
            break;
        }
+        case SPELLFAMILY_WARLOCK:
+            switch (spell->Id)
+            {
+                case 48018:
+                    GameObject* obj = m_target->GetGameObject(spell->Id);
+                    if (!obj) return;
+                    // We must take a range of teleport spell, not summon.
+                    const SpellEntry* goToCircleSpell = sSpellStore.LookupEntry(48020);
+                    if (m_target->IsWithinDist(obj,GetSpellMaxRange(sSpellRangeStore.LookupEntry(goToCircleSpell->rangeIndex))))
+                        SendFakeAuraUpdate(62388,false);
+                    else
+                        SendFakeAuraUpdate(62388,true);
+            }
+            break;
        case SPELLFAMILY_ROGUE:
        {
            switch (spell->Id)
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index a691c75..536cf2e 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -274,6 +274,7 @@ class MANGOS_DLL_SPEC Aura

        void SetAura(bool remove) { m_target->SetVisibleAura(m_auraSlot, remove ? 0 : GetId()); }
        void SendAuraUpdate(bool remove);
+        void SendFakeAuraUpdate(uint32 auraId, bool remove);

        int8 GetStackAmount() {return m_stackAmount;}
        void SetStackAmount(uint8 num);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index c1cfd68..f606453 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -5814,7 +5814,7 @@ void Spell::EffectSummonObject(uint32 i)
    if(uint64 guid = m_caster->m_ObjectSlot[slot])
    {
        if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL)
-            obj->SetLootState(GO_JUST_DEACTIVATED);
+            if(obj) m_caster->RemoveGameObject(obj,true);
        m_caster->m_ObjectSlot[slot] = 0;
    }

Link to comment
Share on other sites

  • 2 weeks later...

also there is a little problem ,when I cast the demonic circle again,the spell 48020 losts its target,

and I find a way to fix it

caster->CastSpell(caster, 60854, true);//remove the demonic circle object by use offical spell

//remove this line where try to remove the demonice circle object manually

m_target->RemoveGameObject(spell->Id,true);

By the way can anyone else tell me how to confirm the condition that a player was indoor,I had asked the same before but noone tell me,I want to use the condition to auto unmount the players when they enter a house just like indoor place...

Link to comment
Share on other sites

In my server we use http://omploader.org/vMjRoNg

the patch works great, but it has a conflict with http://es.wowhead.com/?spell=33831

so you have to include

 @@ -573,6 +573,7 @@ void Spell::FillTargetMap()
                break;
            case TARGET_AREAEFFECT_CUSTOM:
                // We MUST select custom target. May be some SetCustomTargetMap(i, tmpUnitMap)
+                if (m_spellInfo->SpellFamilyName==SPELLFAMILY_WARLOCK)
                break;
            default:
                switch(m_spellInfo->EffectImplicitTargetB[i])

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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