diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-01-23 22:03:24 -0300 | 
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-01-23 22:03:24 -0300 | 
| commit | 2db3e86d9bf200e5049e553160bc47b7bacac621 (patch) | |
| tree | 62df87eb37936d49b192a3590097e3c78d24c59b /src | |
| parent | 53eb6ec61628147046f1e8996e05921a00726c11 (diff) | |
Core/Scripts: implemented Gnomish Harm Prevention Belt
Updates #18542
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 41 | 
1 files changed, 41 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 3682a1b7243..2ff1e916f96 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1146,6 +1146,46 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader          }  }; +// Item 10721: Gnomish Harm Prevention Belt  +// 13234 - Harm Prevention Belt +enum HarmPreventionBelt +{ +    SPELL_FORCEFIELD_COLLAPSE = 13235 +}; + +class spell_item_harm_prevention_belt : public SpellScriptLoader +{ +    public: +        spell_item_harm_prevention_belt() : SpellScriptLoader("spell_item_harm_prevention_belt") { } + +        class spell_item_harm_prevention_belt_AuraScript : public AuraScript +        { +            PrepareAuraScript(spell_item_harm_prevention_belt_AuraScript); + +            bool Validate(SpellInfo const* /*spellInfo*/) override +            { +                if (!sSpellMgr->GetSpellInfo(SPELL_FORCEFIELD_COLLAPSE)) +                    return false; +                return true; +            } + +            void HandleProc(ProcEventInfo& /*eventInfo*/) +            { +                GetTarget()->CastSpell((Unit*)nullptr, SPELL_FORCEFIELD_COLLAPSE, true); +            } + +            void Register() override +            { +                OnProc += AuraProcFn(spell_item_harm_prevention_belt_AuraScript::HandleProc); +            } +        }; + +        AuraScript* GetAuraScript() const override +        { +            return new spell_item_harm_prevention_belt_AuraScript(); +        } +}; +  // Item 23004 - Idol of Longevity  // 28847 - Healing Touch Refund  enum IdolOfLongevity @@ -4558,6 +4598,7 @@ void AddSC_item_spell_scripts()      new spell_item_flask_of_the_north();      new spell_item_frozen_shadoweave();      new spell_item_gnomish_death_ray(); +    new spell_item_harm_prevention_belt();      new spell_item_healing_touch_refund();      new spell_item_heartpierce<SPELL_INVIGORATION_ENERGY, SPELL_INVIGORATION_MANA, SPELL_INVIGORATION_RAGE, SPELL_INVIGORATION_RP>("spell_item_heartpierce");      new spell_item_heartpierce<SPELL_INVIGORATION_ENERGY_HERO, SPELL_INVIGORATION_MANA_HERO, SPELL_INVIGORATION_RAGE_HERO, SPELL_INVIGORATION_RP_HERO>("spell_item_heartpierce_hero");  | 
