Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.3.5] harmful spell hit with stand state and stealth #14819

Closed
robinsch opened this issue May 31, 2015 · 5 comments
Closed

[3.3.5] harmful spell hit with stand state and stealth #14819

robinsch opened this issue May 31, 2015 · 5 comments

Comments

@robinsch
Copy link
Contributor

Currently (562da2e) only harmful CC spells will break stealth and modify the unit stand state.

This behaviour is wrong. All harmful spell hit should break stealth and modify the stand state. There are a few exception for the stealth break mechanic such as:

  • Mass Dispel (http://wowwiki.wikia.com/Mass_Dispel - Patch 2.2.0 (25-Sep-2007): Has a chance to be resisted when dispelling immunity effects. This will be displayed in the combat log. In addition, it will no longer cause rogues and druids in Cat Form to lose Stealth. The flashing area graphic has been removed.)
  • Earthbind Totem (Pulse) (http://wowwiki.wikia.com/Earthbind_Totem - Patch 2.2.0 (25-Sep-2007): Earthbind Totem no longer breaks stealth.)
  • Distract (http://www.wowhead.com/spell=1725/distract#comments:id=814676 - It doesn't break stealth. But for instance if it's a rogue on rogue fight distract can actually cost him enough time such that you will be able to pull off a cheapshot on him.)
    We don't have a spellAttr that states that spells should not break stealth on harmful spell hits. I also can't find them having something common.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@robinsch
Copy link
Contributor Author

```diff
From 3e95e84a76926d1de7fe18f9bcc7c3ee1b68cd01 Mon Sep 17 00:00:00 2001
From: robinsch <robin.schriever.hude@web.de>
Date: Mon, 1 Jun 2015 12:28:19 +0200
Subject: [PATCH] #14819

---
 src/server/game/Spells/Spell.cpp    |  9 ++++-----
 src/server/game/Spells/SpellInfo.h  |  2 +-
 src/server/game/Spells/SpellMgr.cpp | 24 ------------------------
 3 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 3c78540..4a9cc33 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2425,9 +2425,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
     {
         m_caster->CombatStart(unit, !m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO));

-        if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC))
-            if (!unit->IsStandState())
-                unit->SetStandState(UNIT_STAND_STATE_STAND);
+        if (!unit->IsStandState())
+            unit->SetStandState(UNIT_STAND_STATE_STAND);
     }

     if (spellHitTarget)
@@ -2511,8 +2510,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
         if (m_caster->_IsValidAttackTarget(unit, m_spellInfo))
         {
             unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
-            /// @todo This is a hack. But we do not know what types of stealth should be interrupted by CC
-            if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer())
+
+            if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
                 unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
         }
         else if (m_caster->IsFriendlyTo(unit))
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index f2808a0..1c3f9af 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -176,7 +176,7 @@ enum SpellCustomAttributes
     SPELL_ATTR0_CU_CONE_LINE                     = 0x00000004,
     SPELL_ATTR0_CU_SHARE_DAMAGE                  = 0x00000008,
     SPELL_ATTR0_CU_NO_INITIAL_THREAT             = 0x00000010,
-    SPELL_ATTR0_CU_AURA_CC                       = 0x00000040,
+    SPELL_ATTR0_CU_DONT_BREAK_STEALTH            = 0x00000040,
     SPELL_ATTR0_CU_DIRECT_DAMAGE                 = 0x00000100,
     SPELL_ATTR0_CU_CHARGE                        = 0x00000200,
     SPELL_ATTR0_CU_PICKPOCKET                    = 0x00000400,
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 1c79e34..91903c3 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2801,14 +2801,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
         {
             switch (spellInfo->Effects[j].ApplyAuraName)
             {
-                case SPELL_AURA_MOD_POSSESS:
-                case SPELL_AURA_MOD_CONFUSE:
-                case SPELL_AURA_MOD_CHARM:
-                case SPELL_AURA_AOE_CHARM:
-                case SPELL_AURA_MOD_FEAR:
-                case SPELL_AURA_MOD_STUN:
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                    break;
                 case SPELL_AURA_PERIODIC_HEAL:
                 case SPELL_AURA_PERIODIC_DAMAGE:
                 case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
@@ -2901,22 +2893,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
         if (spellInfo->SpellVisual[0] == 3879)
             spellInfo->AttributesCu |= SPELL_ATTR0_CU_CONE_BACK;

-        switch (spellInfo->SpellFamilyName)
-        {
-            case SPELLFAMILY_WARRIOR:
-                // Shout
-                if (spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20)
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                break;
-            case SPELLFAMILY_DRUID:
-                // Roar
-                if (spellInfo->SpellFamilyFlags[0] & 0x8)
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                break;
-            default:
-                break;
-        }
-
         spellInfo->_InitializeExplicitTargetMask();
     }

-- 
1.9.5.msysgit.1
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES ('32375', '64');
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES ('32592', '64');
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES ('39897', '64');
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES ('3600', '64');
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES ('1725', '64');

@ghost
Copy link

ghost commented Jun 1, 2015

Are the 2 C++ code patches meant to be used in PR #14765, or should they be put in a separate PR?

BTW, I am fairly certain that the SQL needs to look something like this:

DELETE FROM `spell_custom_attr` WHERE `entry` IN (1725,3600,32375,32592,39897);
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
(1725, 64),  -- rogue spell 1725, Distract
(3600, 64),  -- Greater Earthbind Totem spell (Earthbind)
(32375, 64), -- priest spell Mass Dispel
(32592, 64), -- priest spell Mass Dispel
(39897, 64); -- priest spell Mass Dispel

If your 2 patches (and the SQL) can be submitted in a separate PR,
I can do it like my 2 previous ones with you as the author of the code.

Edit: added spell names in comments to the spell entry values.

@robinsch
Copy link
Contributor Author

robinsch commented Jun 1, 2015

All in one.

@robinsch
Copy link
Contributor Author

robinsch commented Jun 1, 2015

My bad, all harmful spells should modify the stand state. It was common to break enemys drinking with mass dispel or distract in arena.

From 3e95e84a76926d1de7fe18f9bcc7c3ee1b68cd01 Mon Sep 17 00:00:00 2001
From: robinsch <robin.schriever.hude@web.de>
Date: Mon, 1 Jun 2015 12:28:19 +0200
Subject: [PATCH] #14819

---
 src/server/game/Spells/Spell.cpp    |  9 ++++-----
 src/server/game/Spells/SpellInfo.h  |  2 +-
 src/server/game/Spells/SpellMgr.cpp | 24 ------------------------
 3 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 3c78540..4a9cc33 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2425,9 +2425,8 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
     {
         m_caster->CombatStart(unit, !m_spellInfo->HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO));

-        if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC))
-            if (!unit->IsStandState())
-                unit->SetStandState(UNIT_STAND_STATE_STAND);
+        if (!unit->IsStandState())
+            unit->SetStandState(UNIT_STAND_STATE_STAND);
     }

     if (spellHitTarget)
@@ -2511,8 +2510,8 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
         if (m_caster->_IsValidAttackTarget(unit, m_spellInfo))
         {
             unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
-            /// @todo This is a hack. But we do not know what types of stealth should be interrupted by CC
-            if (m_spellInfo->HasAttribute(SPELL_ATTR0_CU_AURA_CC) && unit->IsControlledByPlayer())
+
+            if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
                 unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
         }
         else if (m_caster->IsFriendlyTo(unit))
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index f2808a0..1c3f9af 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -176,7 +176,7 @@ enum SpellCustomAttributes
     SPELL_ATTR0_CU_CONE_LINE                     = 0x00000004,
     SPELL_ATTR0_CU_SHARE_DAMAGE                  = 0x00000008,
     SPELL_ATTR0_CU_NO_INITIAL_THREAT             = 0x00000010,
-    SPELL_ATTR0_CU_AURA_CC                       = 0x00000040,
+    SPELL_ATTR0_CU_DONT_BREAK_STEALTH            = 0x00000040,
     SPELL_ATTR0_CU_DIRECT_DAMAGE                 = 0x00000100,
     SPELL_ATTR0_CU_CHARGE                        = 0x00000200,
     SPELL_ATTR0_CU_PICKPOCKET                    = 0x00000400,
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 1c79e34..91903c3 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2801,14 +2801,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
         {
             switch (spellInfo->Effects[j].ApplyAuraName)
             {
-                case SPELL_AURA_MOD_POSSESS:
-                case SPELL_AURA_MOD_CONFUSE:
-                case SPELL_AURA_MOD_CHARM:
-                case SPELL_AURA_AOE_CHARM:
-                case SPELL_AURA_MOD_FEAR:
-                case SPELL_AURA_MOD_STUN:
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                    break;
                 case SPELL_AURA_PERIODIC_HEAL:
                 case SPELL_AURA_PERIODIC_DAMAGE:
                 case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
@@ -2901,22 +2893,6 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
         if (spellInfo->SpellVisual[0] == 3879)
             spellInfo->AttributesCu |= SPELL_ATTR0_CU_CONE_BACK;

-        switch (spellInfo->SpellFamilyName)
-        {
-            case SPELLFAMILY_WARRIOR:
-                // Shout
-                if (spellInfo->SpellFamilyFlags[0] & 0x20000 || spellInfo->SpellFamilyFlags[1] & 0x20)
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                break;
-            case SPELLFAMILY_DRUID:
-                // Roar
-                if (spellInfo->SpellFamilyFlags[0] & 0x8)
-                    spellInfo->AttributesCu |= SPELL_ATTR0_CU_AURA_CC;
-                break;
-            default:
-                break;
-        }
-
         spellInfo->_InitializeExplicitTargetMask();
     }

-- 
1.9.5.msysgit.1

@Raydor
Copy link

Raydor commented Aug 2, 2015

@robinsch With this change, Demoralizing Shout from warriors makes the rogue to not break his stealth, is this intended? Before this change it was breaking stealth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants