diff options
author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-27 19:41:32 +0200 |
---|---|---|
committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-27 19:41:32 +0200 |
commit | 4d315bee3d36e2d4c6714ab570e50503f00d23cf (patch) | |
tree | 3eb5712702e3b0bc0b2ebd9f2a9a204dc00b7fc1 | |
parent | 24b0a6f6c3ad35104f1774c1478a3c9b3e82d6eb (diff) |
Core/Spells: Convert "Maim Interrupt" and "Deadly Throw Interrupt" in generic script
-rw-r--r-- | sql/updates/world/2013_07_27_07_world_spell_script_names_434.sql | 6 | ||||
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 23 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 43 |
3 files changed, 49 insertions, 23 deletions
diff --git a/sql/updates/world/2013_07_27_07_world_spell_script_names_434.sql b/sql/updates/world/2013_07_27_07_world_spell_script_names_434.sql new file mode 100644 index 00000000000..781691f15b3 --- /dev/null +++ b/sql/updates/world/2013_07_27_07_world_spell_script_names_434.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +32748,44835 +); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(32748,'spell_gen_interrupt'), +(44835,'spell_gen_interrupt'); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 8c126ac633a..f0dadd2ea39 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5674,13 +5674,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Maim Interrupt - case 44835: - { - // Deadly Interrupt Effect - triggered_spell_id = 32747; - break; - } // Item - Druid T10 Balance 4P Bonus case 70723: { @@ -5716,22 +5709,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case SPELLFAMILY_ROGUE: - { - switch (dummySpell->Id) - { - case 32748: // Deadly Throw Interrupt - { - // Prevent cast Deadly Throw Interrupt on self from last effect (apply dummy) of Deadly Throw - if (this == victim) - return false; - - triggered_spell_id = 32747; - break; - } - } - break; - } case SPELLFAMILY_PALADIN: { // Light's Beacon - Beacon of Light diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index b155d4d38e2..91540bed7b0 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1715,6 +1715,48 @@ class spell_gen_gunship_portal : public SpellScriptLoader } }; + +enum Interrupt +{ + SPELL_GEN_THROW_INTERRUPT = 32747 +}; + +// 32748 - Deadly Throw Interrupt +// 44835 - Maim Interrupt +class spell_gen_interrupt : public SpellScriptLoader +{ + public: + spell_gen_interrupt() : SpellScriptLoader("spell_gen_interrupt") { } + + class spell_gen_interrupt_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_interrupt_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_THROW_INTERRUPT)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_GEN_THROW_INTERRUPT, true, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_gen_interrupt_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_gen_interrupt_AuraScript(); + } +}; + enum Launch { SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251 @@ -3650,6 +3692,7 @@ void AddSC_generic_spell_scripts() new spell_gen_increase_stats_buff("spell_pri_shadow_protection"); new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance"); new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance"); + new spell_gen_interrupt(); new spell_gen_launch(); new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL); |