diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-20 20:52:40 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-20 20:52:40 +0200 |
| commit | 99d34bde1bfa385723f8a65ac068509325d8679c (patch) | |
| tree | f457100290110a1e308d492d3b3a7881d6c0f9af | |
| parent | b4e4c900070d9d64e9a5bbea3746dbe8048b979d (diff) | |
Core/Spells: Update/Convert mage "Glyph of Polymorph" for 4.3.4
| -rw-r--r-- | sql/updates/world/2013_07_20_05_world_spell_script_misc_434.sql | 7 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 10 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 45 |
3 files changed, 52 insertions, 10 deletions
diff --git a/sql/updates/world/2013_07_20_05_world_spell_script_misc_434.sql b/sql/updates/world/2013_07_20_05_world_spell_script_misc_434.sql new file mode 100644 index 00000000000..e625bf0a544 --- /dev/null +++ b/sql/updates/world/2013_07_20_05_world_spell_script_misc_434.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=56375; +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(56375,'spell_mage_glyph_of_polymorph'); + +DELETE FROM `spell_proc_event` WHERE `entry`=56375; +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(56375, 0, 3, 16777216, 0, 0, 65536, 0, 0, 100, 0); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 72e44e49abc..1103bb9c10f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -5432,16 +5432,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } switch (dummySpell->Id) { - // Glyph of Polymorph - case 56375: - { - if (!target) - return false; - target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(32409)); // SW:D shall not be removed. - target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); - target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); - return true; - } // Glyph of Icy Veins case 56374: { diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 91b5d154d4c..28283c8ba1e 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -89,6 +89,11 @@ enum MageIcons ICON_MAGE_IMPROVED_MANA_GEM = 1036 }; +enum MiscSpells +{ + SPELL_PRIEST_SHADOW_WORD_DEATH = 32409 +}; + // -31571 - Arcane Potency class spell_mage_arcane_potency : public SpellScriptLoader { @@ -689,6 +694,45 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader } }; +// 56375 - Glyph of Polymorph +class spell_mage_glyph_of_polymorph : public SpellScriptLoader +{ + public: + spell_mage_glyph_of_polymorph() : SpellScriptLoader("spell_mage_glyph_of_polymorph") { } + + class spell_mage_glyph_of_polymorph_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_glyph_of_polymorph_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_SHADOW_WORD_DEATH)) + return false; + return true; + } + + void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + Unit* target = eventInfo.GetProcTarget(); + + target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE, 0, target->GetAura(SPELL_PRIEST_SHADOW_WORD_DEATH)); // SW:D shall not be removed. + target->RemoveAurasByType(SPELL_AURA_PERIODIC_DAMAGE_PERCENT); + target->RemoveAurasByType(SPELL_AURA_PERIODIC_LEECH); + } + + void Register() OVERRIDE + { + OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_polymorph_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_mage_glyph_of_polymorph_AuraScript(); + } +}; + // -44457 - Living Bomb class spell_mage_living_bomb : public SpellScriptLoader { @@ -1333,6 +1377,7 @@ void AddSC_mage_spell_scripts() new spell_mage_ice_barrier(); new spell_mage_ignite(); new spell_mage_glyph_of_ice_block(); + new spell_mage_glyph_of_polymorph(); new spell_mage_living_bomb(); new spell_mage_mage_ward(); new spell_mage_mana_shield(); |
