Jump to content

[fix] demonic circle


Auntie Mangos

Recommended Posts

  • Replies 83
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 435f7d2..b199dab 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2166,6 +2166,11 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
        {
            // add here custom effects that need default target.
            // FOR EVERY TARGET TYPE THERE IS A DIFFERENT FILL!!
+            if (m_spellInfo->SpellFamilyFlags2 & UI64LIT (0x00000020) && m_spellInfo->SpellIconID == 3217)
+            {
+                TagUnitMap.push_back(m_caster);
+                break;
+            }
            switch(m_spellInfo->Effect[effIndex])
            {
                case SPELL_EFFECT_DUMMY:
@@ -3945,7 +3950,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 c1723f7..00887b2 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1225,6 +1225,38 @@ bool 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);
@@ -4245,6 +4277,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)
    {
@@ -4465,6 +4509,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
@@ -7025,6 +7084,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 3973382..f5d4f2e 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -276,6 +276,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);

Only one bug exists - on logout object is deleted (it's ok), but demonic circle aura is saved to DB (character_aura). It's not critical, but can confuse you or enemy player that thinks you have the portal, but you doesn't have it.

Link to comment
Share on other sites

Sorry but when I try to compile with this patch i have this error:

../../../src/game/SpellAuras.cpp: In member function 'void Aura::HandlePeriodicDamage(bool, bool)':
../../../src/game/SpellAuras.cpp:4635: error: 'spell' was not declared in this scope
make[3]: *** [spellAuras.o] Error 1
make[3]: *** Waiting for unfinished jobs....

why ?

Link to comment
Share on other sites

This patch never be added, cuz it's hack, in DBC spell 62388 not exist. May be after implementation table for spells like this. :confused:

This confirms theory about different DBC in client and blizz-server. If the data is wrong, we can say that we just interpreting it wrong way, but if there isnt even line with this spell? But anyway, we cant get blizz-server DBC(if any), so making DB table would be the best solution. I would start a thread about this, but I worry that I am not enough mangos-expirencied to code something like that :(

Link to comment
Share on other sites

  • 2 weeks later...
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