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

Earth Shield - Occasionally fails to proc #9145

Closed
LordUsagi opened this issue Feb 4, 2013 · 7 comments · Fixed by #10336
Closed

Earth Shield - Occasionally fails to proc #9145

LordUsagi opened this issue Feb 4, 2013 · 7 comments · Fixed by #10336

Comments

@LordUsagi
Copy link

Earth Shield will proc a charge every melee hit, but you'll only be healed for every second or third hit.

Now I know the ability says this can only occur every few seconds, but should it still remove the charge if the heal cannot occur?

@Vincent-Michael
Copy link
Contributor

@joschiwald
Copy link
Contributor

i know, atm. i have no time to fix it in a pr

diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -302,23 +302,29 @@ class spell_sha_earth_shield : public SpellScriptLoader
                 }
             }

-            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+            bool CheckProc(ProcEventInfo& /*eventInfo*/)
             {
-                PreventDefaultAction();
-
                 //! HACK due to currenct proc system implementation
                 if (Player* player = GetTarget()->ToPlayer())
                     if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL))
-                        return;
+                        return false;
+                return true;
+            }
+
+            void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+            {
+                PreventDefaultAction();

                 GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID());

+                /// @ HACK due to currenct proc system implementation
                 if (Player* player = GetTarget()->ToPlayer())
                     player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3);
             }

             void Register()
             {
+                DoCheckProc += AuraCheckProcFn(spell_sha_earth_shield_AuraScript::CheckProc);
                 DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY);
                 OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
             }

@ghost ghost assigned Subv Feb 4, 2013
@LordUsagi
Copy link
Author

Kind of love you ^

@digz6666
Copy link

digz6666 commented Feb 4, 2013

Thank you @joschiwald 👍

@LordUsagi
Copy link
Author

Can we get a PR of this and close it

@Jildor
Copy link
Contributor

Jildor commented Apr 5, 2013

How to reproduce the bug?

joschiwald added a commit to joschiwald/TrinityCore that referenced this issue Jul 24, 2013
- Fix Earth Shield
- Fix Necrotic Touch
- Fix Reflective Shield

Closes TrinityCore#9145, TrinityCore#9163, TrinityCore#9665
@impas
Copy link

impas commented Jul 25, 2013

Earth Shield doesnt work again on 4.3.4 branch

raczman pushed a commit to raczman/TrinityCore that referenced this issue Apr 20, 2014
- Fix Earth Shield
- Fix Necrotic Touch
- Fix Reflective Shield

Closes TrinityCore#9145, TrinityCore#9163, TrinityCore#9665
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants