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] Spell: Trinket PVP/Human Racial can not be used under incapacitation effects #18798

Closed
djbarrueco opened this issue Jan 11, 2017 · 8 comments

Comments

@djbarrueco
Copy link

djbarrueco commented Jan 11, 2017

Description:
Trinket PVP/Every Man for Himself can not be used under the following incapacitation effects:

  1. Sap-Rogue
  2. Seduction-Succubus-Warlock
  3. Cyclone-Druid
  4. Repetance-Paladin

Maybe there are more spells with the same problem.

Current behaviour:
Trinket PVP can not be used under incapacitation effects.

Expected behaviour:
Trinket PVP should remove incapacitation effects.

Steps to reproduce the problem:

  1. Cast Cyclone/Sap/Seduction/Repetance to an human enemy.
  2. Human use Trinket PVP or Every Man for Himself.
  3. Message: Cant do that while banished/sapped/charmed/incapacited.

Branch(es): 3.3.5

TC rev. hash/commit: 151a067

TDB version: TDB_full_world_335.62_2016_10_17 + updates

Operating system: Windows

@djbarrueco djbarrueco changed the title [3.3.5] Spell/Druid: Trinket PVP/Human Racial can not be used under effects of cyclone [3.3.5] Spell: Trinket PVP/Human Racial can not be used under incapacited effects Jan 12, 2017
@djbarrueco djbarrueco changed the title [3.3.5] Spell: Trinket PVP/Human Racial can not be used under incapacited effects [3.3.5] Spell: Trinket PVP/Human Racial can not be used under incapacitation effects Jan 12, 2017
@lmdelval
Copy link

hmmmm confirmed, big problem here.

@Mrgrasser
Copy link

yeh , confirm , again important problem :(
TC rev. hash/commit: 7d4ca0b

@Eliminationzx
Copy link
Contributor

Eliminationzx commented Jan 12, 2017

Try this

diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index eeb6dd6..a40d61a 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5764,16 +5764,17 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
         // spell is usable while stunned, check if caster has allowed stun auras, another stun types must prevent cast spell
         if (usableWhileStunned)
         {
-            static uint32 const allowedStunMask =
-                1 << MECHANIC_STUN
-                | 1 << MECHANIC_SLEEP;
-
+            uint32 mask = 1 << MECHANIC_STUN;
+            // spell with these auras is usable if caster has different stun types
+            bool usable = m_spellInfo->HasAura(SPELL_AURA_MECHANIC_IMMUNITY) || m_spellInfo->HasAura(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); 
             bool foundNotStun = false;
             Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN);
+
             for (AuraEffect const* stunEff : stunAuras)
             {
                 uint32 const stunMechanicMask = stunEff->GetSpellInfo()->GetAllEffectsMechanicMask();
-                if (stunMechanicMask && !(stunMechanicMask & allowedStunMask))
+
+                if (stunMechanicMask && !(stunMechanicMask & mask))
                 {
                     foundNotStun = true;
 
@@ -5781,14 +5782,16 @@ SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
                     if (param1)
                     {
                         *param1 = stunEff->GetSpellInfo()->Effects[stunEff->GetEffIndex()].Mechanic;
+
                         if (!*param1)
                             *param1 = stunEff->GetSpellInfo()->Mechanic;
                     }
+
                     break;
                 }
             }
 
-            if (foundNotStun)
+            if (foundNotStun && !usable)
                 result = SPELL_FAILED_STUNNED;

p.s it also fix alot of issues about spells which usable if caster has different stun types.

@djbarrueco
Copy link
Author

djbarrueco commented Jan 12, 2017

@Eliminationzx please post when you finish, i can not follow you with so many post updates :)

@Eliminationzx
Copy link
Contributor

Sorry. I finished.

@djbarrueco
Copy link
Author

djbarrueco commented Jan 12, 2017

With your patch the trinket pvp can be used again. it require to be checked by @ariel- because he wrote the last code about this.
Can you be more specific about

p.s it also fix alot of issues about spells which usable if caster has different stun types.

?

@Eliminationzx
Copy link
Contributor

Eliminationzx commented Jan 13, 2017

@noryad, it fix spells like - hand of freedom, barkskin, lichborne, pain suppression(with glyph), PvP trinkets, human racial and etc, they are usable while different stun types (MECHANIC_STUN, MECHANIC_SAPPED, MECHANIC_FREEZE, MECHANIC_SLEEP, MECHANIC_CHARM, MECHANIC_HORROR, MECHANIC_BANISH).

The reason for that:

  1. attribute SPELL_ATTR5_USABLE_WHILE_STUNNED
  2. specific aura type SPELL_AURA_MECHANIC_IMMUNITY, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN.

I came to this conclusion after comparing all spells with these aura types and attribute SPELL_ATTR5_USABLE_WHILE_STUNNED.

@lmdelval
Copy link

@ariel- solve this please, pvp does not make sense with this problem :(

@TrinityCore TrinityCore locked and limited conversation to collaborators Jan 20, 2017
ghost pushed a commit that referenced this issue Jan 23, 2017
Allowed mechanic mask is calculated on startup and auras checked against those mechanics
Closes #18798
Shauren pushed a commit that referenced this issue Jun 15, 2019
Allowed mechanic mask is calculated on startup and auras checked against those mechanics
Closes #18798

(cherrypicked from 3544577)
(cherrypicked from 53eb6ec)
TheGhostGroup pushed a commit to TheGhostGroup/TrinityCore that referenced this issue Jan 29, 2022
Allowed mechanic mask is calculated on startup and auras checked against those mechanics
Closes TrinityCore#18798

(cherrypicked from 3544577)
(cherrypicked from 53eb6ec)

(cherry picked from commit 2b0c739)

# Conflicts:
#	src/server/game/Spells/Spell.cpp
TheGhostGroup pushed a commit to TheGhostGroup/TrinityCore that referenced this issue Mar 17, 2022
Allowed mechanic mask is calculated on startup and auras checked against those mechanics
Closes TrinityCore#18798

(cherrypicked from 3544577)
(cherrypicked from 53eb6ec)

(cherry picked from commit 2b0c739)

# Conflicts:
#	src/server/game/Spells/Spell.cpp
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants