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.5a][Hunter] Core/Spell: Cobra strikes #754

Closed
click opened this issue May 16, 2011 · 15 comments
Closed

[3.3.5a][Hunter] Core/Spell: Cobra strikes #754

click opened this issue May 16, 2011 · 15 comments

Comments

@click
Copy link
Contributor

click commented May 16, 2011

trinitiycore rev 10160+ release hash 675235637ce4+ (unix-little endian)

http://www.wowwiki.com/Cobra_Strikes

''You have a X% chance when you critically hit with Arcane Shot, Steady Shot or Kill Shot to cause your pet's next 2 special attacks to critically hit.''

'''problem'''-charges dont disapear after pet make critical..

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

@click
Copy link
Contributor Author

click commented May 16, 2011

Author: signfinder
confirmed
today TC revision

@wilds
Copy link
Contributor

wilds commented May 18, 2011

ekserver/ekcore@62550f8

@HamedGhasemi
Copy link

confirmed
today TC revision
last DB updates

@Faq
Copy link
Contributor

Faq commented May 19, 2012

@ghost ghost assigned QAston Jul 13, 2012
@ghost ghost assigned Star-lion Sep 6, 2012
@ghost ghost assigned Subv Nov 13, 2012
@s7an-it
Copy link
Contributor

s7an-it commented Apr 4, 2013

This is a bit imblalanced bug then, no? Did anyone test tibbi fix based on tobmaps initial work?

@danlapps
Copy link
Contributor

Was https://github.com/gc/TrinityCore/commit/a43b5f1148ec28763d1140d247bf6c440ddbee68 a valid fix, and/or is this still an issue ?

@Rushor
Copy link
Contributor

Rushor commented Mar 15, 2015

this should/can be done with a spellscript

@ghost
Copy link

ghost commented Mar 15, 2015

Im using this fix, and still works

@ghost
Copy link

ghost commented Oct 15, 2015

@Frytiks : are you using tobmaps' version ekserver/ekcore@62550f8 or tibbi's version https://github.com/gc/TrinityCore/commit/a43b5f1148ec28763d1140d247bf6c440ddbee68 ?

@ghost
Copy link

ghost commented Oct 15, 2015

Tibbi

@ghost
Copy link

ghost commented Oct 15, 2015

OK, thanks for confirming. Are you using the code unchanged, like this?

diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index e42f66c..6f61546 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -342,6 +342,14 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEven
     if (m_spellInfo->ManaPerSecond || m_spellInfo->ManaPerSecondPerLevel)
         m_timeCla = 1 * IN_MILLISECONDS;

+    switch (m_spellInfo->Id)
+    {
+        // some auras should have max stacks at applying
+        case 53257:                                         // Cobra Strikes
+            m_stackAmount = spellproto->StackAmount;
+            break;
+    }
+
     m_maxDuration = CalcMaxDuration(caster);
     m_duration = m_maxDuration;
     m_procCharges = CalcMaxCharges(caster);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index e1302d4..958e18f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2401,6 +2401,12 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
                 caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
         }

+        // Reduce amount of Cobra Strikes aura stacks by 1 for each crit
+        if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellInfo->SpellFamilyFlags[1] & 0x10000000)
+            if (Unit * owner = caster->GetOwner())
+                if (Aura* pAura = owner->GetAura(53257))
+                    pAura->ModStackAmount(-1);
+
         m_damage = damageInfo.damage;

         caster->DealSpellDamage(&damageInfo, true);

Or have you made any practical changes, based on the current 3.3.5 source code?

In the diff from Spell.cpp, the order is reversed for the last 2 visible lines compared to the 2012 source:

         m_damage = damageInfo.damage;

         caster->DealSpellDamage(&damageInfo, true);

In tibbi's commit, these 2 lines were arranged the opposite way because of source code from 2012, so I was a bit uncertain where the correct insertion point would be for the fix. (I just took a chance.)

I also noticed the aura spell ID should be replaced with an enum in a commit. Any other improvements?

Edit: since this issue is so old (pre-github), it deserves some attention towards fixing it.
@Rushor, you said "this should/can be done with a spellscript", do you mean SAI or something else?
@Keader, @Goatform : have you tested this code, do you have any suggestions for or against it?

@Rushor
Copy link
Contributor

Rushor commented Dec 4, 2015

no i mean a spellscript like in spell_taldaram_ball_of_inferno_flame

@Rushor
Copy link
Contributor

Rushor commented Feb 7, 2016

that's not a fix, it's a hack

@ghost
Copy link

ghost commented Feb 9, 2016

OK, so this issue really needs a SpellScript like you said last year. I will check with one of my contacts if he would be interested in creating a spellscript for this.

@Rushor Rushor changed the title [3.3.5a] [Hunter] Cobra strikes [3.3.5a][Hunter] Core/Spell: Cobra strikes Feb 9, 2016
Aokromes pushed a commit to Aokromes/TrinityCore that referenced this issue Sep 1, 2016
@Keader
Copy link
Member

Keader commented Nov 1, 2016

Just for references: 0c59f2f

joschiwald pushed a commit that referenced this issue Feb 18, 2017
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue Mar 13, 2017
Krudor pushed a commit to Krudor/TrinityCore that referenced this issue Jul 13, 2017
conan513 pushed a commit to conan513/SingleCore_TC that referenced this issue May 6, 2018
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