aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_07_20_07_world_spell_script_misc_434.sql13
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp18
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp83
3 files changed, 77 insertions, 37 deletions
diff --git a/sql/updates/world/2013_07_20_07_world_spell_script_misc_434.sql b/sql/updates/world/2013_07_20_07_world_spell_script_misc_434.sql
new file mode 100644
index 00000000000..1705485c672
--- /dev/null
+++ b/sql/updates/world/2013_07_20_07_world_spell_script_misc_434.sql
@@ -0,0 +1,13 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (-11175);
+INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
+(-11175,'spell_mage_permafrost');
+
+DELETE FROM `spell_ranks` WHERE `first_spell_id`=11175;
+INSERT INTO `spell_ranks` (`first_spell_id`, `spell_id`, `rank`) VALUES
+(11175, 11175, 1),
+(11175, 12569, 2),
+(11175, 12571, 3);
+
+DELETE FROM `spell_bonus_data` WHERE `entry`=91394;
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(91394, 0, 0, 0, 0, 'Mage - Permafrost');
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2d0852510a3..a37630a2b37 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5430,24 +5430,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
triggered_spell_id = 37436;
break;
}
- switch (dummySpell->Id)
- {
- // Permafrost
- case 11175:
- case 12569:
- case 12571:
- {
- if (!GetGuardianPet())
- return false;
-
- // heal amount
- basepoints0 = CalculatePct(damage, triggerAmount);
- target = this;
- triggered_spell_id = 91394;
- break;
- }
- }
- break;
}
case SPELLFAMILY_WARRIOR:
{
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index ec1e5861599..8adac7be0e2 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -44,6 +44,7 @@ enum MageSpells
SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413,
SPELL_MAGE_IGNITE = 12654,
SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077,
+ SPELL_MAGE_PERMAFROST = 91394,
SPELL_MAGE_SLOW = 31589,
SPELL_MAGE_SQUIRREL_FORM = 32813,
SPELL_MAGE_GIRAFFE_FORM = 32816,
@@ -697,31 +698,31 @@ class spell_mage_glyph_of_ice_block : public SpellScriptLoader
// 56374 - Glyph of Icy Veins
class spell_mage_glyph_of_icy_veins : public SpellScriptLoader
{
-public:
- spell_mage_glyph_of_icy_veins() : SpellScriptLoader("spell_mage_glyph_of_icy_veins") { }
-
- class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript);
+ public:
+ spell_mage_glyph_of_icy_veins() : SpellScriptLoader("spell_mage_glyph_of_icy_veins") { }
- void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
+ class spell_mage_glyph_of_icy_veins_AuraScript : public AuraScript
{
- PreventDefaultAction();
+ PrepareAuraScript(spell_mage_glyph_of_icy_veins_AuraScript);
- GetTarget()->RemoveAurasByType(SPELL_AURA_HASTE_SPELLS, 0, 0, true, false);
- GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
- }
+ void HandleEffectProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
- void Register() OVERRIDE
+ GetTarget()->RemoveAurasByType(SPELL_AURA_HASTE_SPELLS, 0, 0, true, false);
+ GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
{
- OnEffectProc += AuraEffectProcFn(spell_mage_glyph_of_icy_veins_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ return new spell_mage_glyph_of_icy_veins_AuraScript();
}
- };
-
- AuraScript* GetAuraScript() const OVERRIDE
- {
- return new spell_mage_glyph_of_icy_veins_AuraScript();
- }
};
// 56375 - Glyph of Polymorph
@@ -1045,6 +1046,49 @@ class spell_mage_nether_vortex : public SpellScriptLoader
}
};
+// -11175 - Permafrost
+class spell_mage_permafrost : public SpellScriptLoader
+{
+ public:
+ spell_mage_permafrost() : SpellScriptLoader("spell_mage_permafrost") { }
+
+ class spell_mage_permafrost_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mage_permafrost_AuraScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_PERMAFROST))
+ return false;
+ return true;
+ }
+
+ bool DoCheck(ProcEventInfo& eventInfo)
+ {
+ return GetTarget()->GetGuardianPet() && eventInfo.GetDamageInfo()->GetDamage();
+ }
+
+ void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
+ {
+ PreventDefaultAction();
+
+ int32 heal = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()));
+ GetTarget()->CastCustomSpell(SPELL_MAGE_PERMAFROST, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff);
+ }
+
+ void Register() OVERRIDE
+ {
+ DoCheckProc += AuraCheckProcFn(spell_mage_permafrost_AuraScript::DoCheck);
+ OnEffectProc += AuraEffectProcFn(spell_mage_permafrost_AuraScript::HandleEffectProc, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const OVERRIDE
+ {
+ return new spell_mage_permafrost_AuraScript();
+ }
+};
+
enum SilvermoonPolymorph
{
NPC_AUROSALIA = 18744
@@ -1414,6 +1458,7 @@ void AddSC_mage_spell_scripts()
new spell_mage_mana_shield();
new spell_mage_master_of_elements();
new spell_mage_nether_vortex();
+ new spell_mage_permafrost();
new spell_mage_polymorph_cast_visual();
new spell_mage_replenish_mana();
new spell_mage_ring_of_frost();