From cdbe16fabea9fe140fb59b510118104b3be1bc9f Mon Sep 17 00:00:00 2001 From: ariel- Date: Mon, 23 Jan 2017 22:03:24 -0300 Subject: Core/Scripts: implemented Gnomish Harm Prevention Belt Updates #18542 (cherry picked from commit 2db3e86d9bf200e5049e553160bc47b7bacac621) --- .../2020_04_10_22_world_2017_01_23_03_world.sql | 7 ++++ src/server/scripts/Spells/spell_item.cpp | 41 ++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 sql/updates/world/master/2020_04_10_22_world_2017_01_23_03_world.sql diff --git a/sql/updates/world/master/2020_04_10_22_world_2017_01_23_03_world.sql b/sql/updates/world/master/2020_04_10_22_world_2017_01_23_03_world.sql new file mode 100644 index 00000000000..32eac33787a --- /dev/null +++ b/sql/updates/world/master/2020_04_10_22_world_2017_01_23_03_world.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_proc` WHERE `SpellId`=13234; +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(13234, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0x403, 0x2, 0, 0, 0, 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_harm_prevention_belt'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(13234, 'spell_item_harm_prevention_belt'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 9836318f066..7461e52e1b4 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1100,6 +1100,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(); + } +}; + enum Heartpierce { SPELL_INVIGORATION_MANA = 71881, @@ -4839,6 +4879,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_heartpierce("spell_item_heartpierce"); new spell_item_heartpierce("spell_item_heartpierce_hero"); new spell_item_crystal_spire_of_karabor(); -- cgit v1.2.3