Jump to content

CC Delay (Crowd Control Delay)[all cores]


trimken

Recommended Posts

Posted

What about CC Delay? I don't know how it work now at another cores, but in mangos,(I tested zero & one cores) not working. I didn't find any discussion about this on old and current forums. In OregonCore (2.4.3) this works correctly, but I didn't find any decision for realize it. (somebody told me that in trinity core is realized too)

Information about cc delay - Crowd control - WoWWiki - Your guide to the World of Warcraft and its universe - Wikia

There are a lot of examples of this "feature" in rogue vs rogue videos (Neilyo vs Akrios By Akrios - World of Warcraft Movies) ... at the begining 0:29 both rogues blinded then at 0:43 rogue vanish rogue's blind... and there is more in the vid

I found only old patches, for cc delay, but this only is temporary solution.

Anybody know, how CCD is realized in oregon or trinity, or maybe you can help me with this patch?

From 01d38623da0f2b5e47a3c00d40d4ef74b4c80049 Mon Sep 17 00:00:00 2001
From: Kozonox <[email protected]>
Date: Mon, 25 Feb 2013 19:16:03 +0100
Subject: [PATCH] Gary cc delay

---
src/server/game/Spells/Spell.cpp |  201 +++++++++++++++++++++++++++++++++++++-
src/server/game/Spells/Spell.h   |    2 +
2 files changed, 201 insertions(+), 2 deletions(-)

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 03e4123..87d7080 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2200,7 +2200,11 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
            m_delayMoment = targetInfo.timeDelay;
    }
    else
-        targetInfo.timeDelay = 0LL;
+    {
+        targetInfo.timeDelay = GetCCDelay(m_spellInfo);
+        if (m_delayMoment == 0 || m_delayMoment > targetInfo.timeDelay)
+            m_delayMoment = targetInfo.timeDelay;
+    }

    // If target reflect spell back to caster
    if (targetInfo.missCondition == SPELL_MISS_REFLECT)
@@ -3327,7 +3331,7 @@ void Spell::cast(bool skipCheck)
    SendSpellGo();

    // Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
-    if ((m_spellInfo->Speed > 0.0f && !m_spellInfo->IsChanneled()) || m_spellInfo->Id == 14157 || m_spellInfo->Id == 70802)
+    if (((m_spellInfo->Speed > 0.0f || GetCCDelay(m_spellInfo) > 0) && !m_spellInfo->IsChanneled()) || m_spellInfo->Id == 14157 || m_spellInfo->Id == 70802)
    {
        // Remove used for cast item if need (it can be already NULL after TakeReagents call
        // in case delayed spell remove item at cast delay start
@@ -5663,6 +5667,199 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
    return CheckCast(true);
}

+uint32 Spell::GetCCDelay(SpellInfo const* _spell)
+{
+    // CCD for spell with auras
+    AuraType auraWithCCD[] = 
+    {
+        SPELL_AURA_MOD_STUN,
+        SPELL_AURA_MOD_CONFUSE,
+        SPELL_AURA_MOD_FEAR,
+        SPELL_AURA_MOD_SILENCE,
+        SPELL_AURA_MOD_DISARM,
+        SPELL_AURA_MOD_ROOT,
+        SPELL_AURA_MOD_POSSESS
+    };
+    uint8 CCDArraySize = 7;
+
+    const uint32 delayForRoots           = 0; // currently unused
+    const uint32 delayForStuns           = 50;
+    const uint32 delayForDisarms         = 0; // currently unused
+    const uint32 delayForDisorients      = 100;
+    const uint32 delayForFears           = 100;
+    const uint32 delayForHorrors         = 50;
+    const uint32 delayForOpenerStuns     = 70;
+    const uint32 delayForScatters        = 100;
+    const uint32 delayForBanishes        = 50;
+    const uint32 NOdelayForInstantSpells = 0;
+
+    switch(_spell->SpellFamilyName)
+    {
+        case SPELLFAMILY_DEATHKNIGHT:
+            // Death Grip
+            if (_spell->Id == 49576)
+                return NOdelayForInstantSpells;
+            // Hungering Cold
+            if (_spell->Id == 49203)
+                return delayForDisorients;
+            // Gnaw (ghoul's stun)
+            if (_spell->Id == 47481)
+                return delayForStuns;
+            break;
+        case SPELLFAMILY_DRUID:
+            // Bash
+            if (_spell->Id == 5211)
+                return delayForStuns;
+            // Cyclone
+            if (_spell->Id == 33786)
+                return delayForBanishes;
+            // Hibernate 
+            if (_spell->Id == 2637)
+                return delayForDisorients;
+            // Feral charge
+            if (_spell->Id == 45334)
+                return NOdelayForInstantSpells; 
+            // Maim
+            if (_spell->Id == 22570)
+                return delayForStuns;
+            // Pounce
+            if (_spell->Id == 9005)
+                return delayForOpenerStuns;
+            break;
+        case SPELLFAMILY_HUNTER: // TODO all pet's cc 
+            // Traps
+            if (_spell->SpellFamilyFlags[0] & 0x8 || // Frozen trap
+                _spell->Id == 57879 || // Snake Trap
+                _spell->SpellFamilyFlags[2] & 0x00024000) // Explosive and Immolation Trap
+                return 0;
+            // Entrapment
+            if (_spell->SpellIconID == 20)
+                return 0;
+            // Scatter Shot
+            if (_spell->Id == 19503)
+                return delayForScatters;
+            // Wyvern Sting
+            if (_spell->Id == 19386)
+                return delayForDisorients;
+            break;
+        case SPELLFAMILY_MAGE:
+             // Deep Freeze
+            if (_spell->Id == 44572)
+                return delayForStuns;
+            // Dragon Breath
+            if (_spell->Id == 42950)
+                return delayForDisorients;
+            // Impact
+            if (_spell->Id == 64343)
+                return delayForStuns;
+            // Polymorph
+            if (_spell->Id == 12826)
+                return delayForDisorients;
+            break;
+        case SPELLFAMILY_PALADIN:
+            // Hammer of Justice
+            if (_spell->Id == 853)
+                return delayForStuns;
+            // Repentance
+            if (_spell->Id == 20066)
+                return delayForDisorients;
+            // Turn Evil
+            if (_spell->Id == 10326)
+                return delayForFears;
+            break;
+        case SPELLFAMILY_PRIEST:
+            // Psychic Scream
+            if (_spell->Id == 10890)
+                 return delayForFears;
+            // Mind Control
+            if (_spell->Id == 605)
+                return delayForBanishes;
+            // Psychic Horror
+            if (_spell->Id == 64044)
+                return delayForHorrors;
+            // Shackle Undead
+            if (_spell->Id == 9484)
+                return delayForDisorients;
+            break;
+        case SPELLFAMILY_ROGUE:
+            // Blind
+            if (_spell->Id == 2094)
+                return delayForDisorients;
+            // CheapShot
+            if (_spell->Id == 1833)
+                return delayForOpenerStuns;
+            // Gouge
+            if (_spell->Id == 1776)
+                return delayForDisorients;
+            // Kidney Shot
+            if (_spell->Id == 408)
+                return delayForStuns;
+            // Sap
+            if (_spell->Id == 6770)
+                return delayForDisorients;
+            break;
+        case SPELLFAMILY_SHAMAN:
+            // Hex
+            if (_spell->Id == 51514)
+                return delayForDisorients;
+            break;
+        case SPELLFAMILY_WARLOCK: // TODO felguard's intercept(27826?), seduction
+            // Banish
+            if (_spell->Id == 710)
+                return delayForBanishes;
+            // DeathCoil
+            if (_spell->Id == 27223)
+                return delayForHorrors;
+            // Demon charge 
+            if (_spell->Id == 60995) // might use 54785 - req testing
+                return delayForStuns;
+            // Fear
+            if (_spell->Id == 5782)
+                return delayForFears;
+            // Howl of Terror
+            if (_spell->Id == 5484)
+                return delayForFears;
+            // Shadowfury
+            if (_spell->Id == 30283)
+                return delayForStuns;
+            // Spell Lock - Debuff
+            if (_spell->Id == 24259)
+                return NOdelayForInstantSpells;
+           break;
+        case SPELLFAMILY_WARRIOR:
+            // Charge
+            if (_spell->Id == 7922)
+                return delayForOpenerStuns;
+            // Charge trig.
+            if (_spell->Id == 65929)
+                return delayForStuns;
+            // Concussion Blow
+            if (_spell->Id == 12809)
+                return delayForStuns;
+            // Intercept
+            if (_spell->Id == 20253)
+                return delayForStuns;
+            // Intimidating Shout
+            if (_spell->Id == 20511)
+                return delayForFears;
+            // Shockwave
+            if (_spell->Id == 46968)
+                return delayForStuns;
+            break;    
+        case SPELLFAMILY_GENERIC: // is that ok?!
+            // War Stomp - Tauren's racial
+            if (_spell->Id == 46026)
+                return delayForStuns;
+            break;
+    }
+
+    for (uint8 i = 0; i < CCDArraySize; ++i)
+         if (_spell->HasAura(auraWithCCD[i]))
+             return NOdelayForInstantSpells;
+
+    return 0;
+}
+
SpellCastResult Spell::CheckCasterAuras() const
{
    // spells totally immuned to caster auras (wsg flag drop, give marks etc)
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 101d6d6..98946d3 100755
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -384,6 +384,8 @@ class Spell
        SpellCastResult CheckCast(bool strict);
        SpellCastResult CheckPetCast(Unit* target);

+        static uint32 GetCCDelay(SpellInfo const* _spell);
+
        // handlers
        void handle_immediate();
        uint64 handle_delayed(uint64 t_offset);
-- 
1.7.10

Archived

This topic is now archived and is 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