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][Spell] Worgen's Call #12165

Closed
Rushor opened this issue May 29, 2014 · 7 comments
Closed

[3.3.5a][Spell] Worgen's Call #12165

Rushor opened this issue May 29, 2014 · 7 comments

Comments

@Rushor
Copy link
Contributor

Rushor commented May 29, 2014

rev c06dc7d // newest DB
spells:
Infected Worgen Bite : 53094
Worgen's Call : 53095

Situation:
You get three stacks of Infected Worgen Bite, but you don't get transformed into a worgen.

How it should be:
After 3 stacks, the aura 53094 should be removed and therefore you get the aura 53095.

proof:
By dreadblood (14,112 – 3·12·124) on 2009/08/25 (Patch 3.2.0)
personally i like to get the 3 debuffs to become a worgen.. its fun :)
http://www.wowhead.com/spell=53095#comments (first)

I tried this, but it does not work.

class spell_worgens_call : public SpellScriptLoader
{
    public:
        spell_worgens_call() : SpellScriptLoader("spell_worgens_call") { }

        class spell_worgens_call_SpellScript : public SpellScript
        {
            public:
                PrepareSpellScript(spell_worgens_call_SpellScript)

            uint32 worgen;

            bool Load()
            {
                worgen = sSpellMgr->GetSpellIdForDifficulty(SPELL_WORGEN_BITE, GetCaster());
                if (!sSpellMgr->GetSpellInfo(worgen))
                    return false;

                return true;
            }

            void HandleScriptEffect(SpellEffIndex /*effIndex*/)
            {
                if (Unit* target = GetHitUnit())
                {
                    if (Aura* pAura = target->GetAura(worgen))
                    {
                        if (pAura->GetStackAmount() >= 3)
                        {
                            if (target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2206, EFFECT_1))
                                target->CastSpell(target, SPELL_WORGEN_CALL, true);

                            target->RemoveAurasDueToSpell(worgen);
                        }
                    }
                }
            }

            void Register()
            {
                OnEffectHitTarget += SpellEffectFn(spell_worgens_call_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
            }
        };

        SpellScript* GetSpellScript() const
        {
            return new spell_worgens_call_SpellScript();
        }
};
@Rushor
Copy link
Contributor Author

Rushor commented May 29, 2014

oke found a working solution:

                    case 53174:
                        if (GetStackAmount() >= 3 && !target->HasAura(53095))
                            target->CastSpell(target, 53095, true);
                            target->RemoveAura(53174);
                        break;

insert into spellauras.cpp in case SPELLFAMILY_GENERIC: near line 1100

@untaught
Copy link
Contributor

Infected Worgen Bite has no SPELL_EFFECT_SCRIPT_EFFECT effect so you can't use it in scripts.
It has only 2 effects which are not subject of scripting with spellscript:

Effect 0: Id 2 (SPELL_EFFECT_SCHOOL_DAMAGE)
BasePoints = 638 to 863
Targets (6, 0) (TARGET_UNIT_TARGET_ENEMY, NO_TARGET)

Effect 1: Id 6 (SPELL_EFFECT_APPLY_AURA)
BasePoints = 150
Targets (6, 0) (TARGET_UNIT_TARGET_ENEMY, NO_TARGET)
Aura Id 3 (SPELL_AURA_PERIODIC_DAMAGE), value = 150, misc = 0 (0), miscB = 0, periodic = 5000

Try with aurascript.

@untaught
Copy link
Contributor

DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=53095;
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
(53095,-53094,2,NULL);

DELETE FROM `spell_script_names` WHERE `spell_id`=53094;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(53094,'spell_infected_worgen_bite');
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index d0fd948..d9846b4 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -786,6 +786,44 @@ class spell_shredder_delivery : public SpellScriptLoader
         }
 };

+enum InfectedWorgenBite
+{
+    INFECTED_WORGEN_BITE    = 53094,
+    WORGENS_CALL            = 53095
+};
+
+class spell_infected_worgen_bite : public SpellScriptLoader
+{
+public:
+    spell_infected_worgen_bite() : SpellScriptLoader("spell_infected_worgen_bite") { }
+
+    class spell_infected_worgen_bite_AuraScript : public AuraScript
+    {
+        PrepareAuraScript(spell_infected_worgen_bite_AuraScript);
+
+        void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+        {
+            Unit* target = GetTarget();
+            if (target->GetTypeId() == TYPEID_PLAYER)
+                if (target->GetAura(INFECTED_WORGEN_BITE)->GetStackAmount() == 3)
+                {
+                    target->RemoveAurasDueToSpell(INFECTED_WORGEN_BITE);
+                    target->CastSpell(target, WORGENS_CALL, true);
+                }
+        }
+
+        void Register() override
+        {
+            AfterEffectApply += AuraEffectApplyFn(spell_infected_worgen_bite_AuraScript::HandleAfterEffectApply, EFFECT_ALL, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+        }
+    };
+
+    AuraScript* GetAuraScript() const override
+    {
+        return new spell_infected_worgen_bite_AuraScript();
+    }
+};
+
 void AddSC_grizzly_hills()
 {
     new npc_emily();
@@ -797,4 +835,5 @@ void AddSC_grizzly_hills()
     new npc_venture_co_straggler();
     new npc_lake_frog();
     new spell_shredder_delivery();
+    new spell_infected_worgen_bite();
 }

Idk if it's in the right place.

@Aokromes
Copy link
Member

Aokromes commented Feb 6, 2015

If this needs c++, can you create a PR for it?

@danlapps
Copy link
Contributor

Is this still an issue or was it fixed in last few commits ?

@Rushor
Copy link
Contributor Author

Rushor commented Mar 14, 2015

waiting for merging the pr

@MitchesD
Copy link
Contributor

0659f5d

Rushor added a commit that referenced this issue Mar 25, 2015
… and Transformation

closes #12165

(cherry picked from commit 6080234)
Rushor added a commit that referenced this issue Mar 25, 2015
… and Transformation

closes #12165

(cherry picked from commit 6080234)
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

5 participants