2010-07-24 22:41:42 +02:00
|
|
|
/*
|
2012-12-31 23:15:50 +01:00
|
|
|
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
2010-07-24 22:41:42 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
|
* option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
|
* more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Scripts for spells with SPELLFAMILY_MAGE and SPELLFAMILY_GENERIC spells used by mage players.
|
|
|
|
|
* Ordered alphabetically using scriptname.
|
2010-07-26 19:05:20 -07:00
|
|
|
* Scriptnames of files in this file should be prefixed with "spell_mage_".
|
2010-07-24 22:41:42 +02:00
|
|
|
*/
|
|
|
|
|
|
2012-11-17 05:18:37 +01:00
|
|
|
#include "Player.h"
|
2012-02-19 16:57:07 +01:00
|
|
|
#include "ScriptMgr.h"
|
|
|
|
|
#include "SpellScript.h"
|
|
|
|
|
#include "SpellAuraEffects.h"
|
|
|
|
|
|
2010-07-26 19:05:20 -07:00
|
|
|
enum MageSpells
|
|
|
|
|
{
|
|
|
|
|
SPELL_MAGE_COLD_SNAP = 11958,
|
|
|
|
|
SPELL_MAGE_SQUIRREL_FORM = 32813,
|
|
|
|
|
SPELL_MAGE_GIRAFFE_FORM = 32816,
|
|
|
|
|
SPELL_MAGE_SERPENT_FORM = 32817,
|
|
|
|
|
SPELL_MAGE_DRAGONHAWK_FORM = 32818,
|
|
|
|
|
SPELL_MAGE_WORGEN_FORM = 32819,
|
|
|
|
|
SPELL_MAGE_SHEEP_FORM = 32820,
|
|
|
|
|
SPELL_MAGE_GLYPH_OF_ETERNAL_WATER = 70937,
|
|
|
|
|
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT = 70908,
|
|
|
|
|
SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY = 70907,
|
2010-09-28 09:11:41 +03:00
|
|
|
SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126,
|
2012-12-01 14:58:56 +01:00
|
|
|
SPELL_MAGE_CONJURE_REFRESHMENT = 42955,
|
2012-12-26 18:03:41 +01:00
|
|
|
SPELL_MAGE_FLAMESTRIKE = 2120,
|
|
|
|
|
SPELL_MAGE_CHILLED_R1 = 12484,
|
|
|
|
|
SPELL_MAGE_CHILLED_R2 = 12485,
|
|
|
|
|
SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED = 44413,
|
|
|
|
|
SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK = 86261,
|
|
|
|
|
SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED = 83098,
|
|
|
|
|
SPELL_MAGE_SHATTERED_BARRIER_R1 = 44745,
|
|
|
|
|
SPELL_MAGE_SHATTERED_BARRIER_R2 = 54787,
|
|
|
|
|
SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1 = 55080,
|
|
|
|
|
SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2 = 83073,
|
|
|
|
|
SPELL_MAGE_FINGERS_OF_FROST = 44544,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum MageIcons
|
|
|
|
|
{
|
|
|
|
|
ICON_MAGE_SHATTER = 976,
|
|
|
|
|
ICON_MAGE_IMPROVED_FLAMESTRIKE = 37,
|
|
|
|
|
ICON_MAGE_IMPROVED_FREEZE = 94,
|
|
|
|
|
ICON_MAGE_INCANTER_S_ABSORPTION = 2941,
|
|
|
|
|
ICON_MAGE_IMPROVED_MANA_GEM = 1036,
|
2010-07-26 19:05:20 -07:00
|
|
|
};
|
|
|
|
|
|
2010-12-30 02:03:46 +01:00
|
|
|
class spell_mage_blast_wave : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_blast_wave() : SpellScriptLoader("spell_mage_blast_wave") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_blast_wave_SpellScript : public SpellScript
|
|
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
PrepareSpellScript(spell_mage_blast_wave_SpellScript);
|
|
|
|
|
|
2011-07-26 23:09:28 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
2012-12-26 18:03:41 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FLAMESTRIKE))
|
2010-12-30 02:03:46 +01:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-26 18:03:41 +01:00
|
|
|
void CountTargets(std::list<WorldObject*>& targetList)
|
|
|
|
|
{
|
|
|
|
|
_targetCount = targetList.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleImprovedFlamestrike()
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
2012-12-26 18:03:41 +01:00
|
|
|
if (_targetCount >= 2)
|
|
|
|
|
if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_FLAMESTRIKE, EFFECT_0))
|
|
|
|
|
if (roll_chance_i(aurEff->GetAmount()))
|
|
|
|
|
{
|
|
|
|
|
float x, y, z;
|
|
|
|
|
WorldLocation const* loc = GetExplTargetDest();
|
|
|
|
|
if (!loc)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
loc->GetPosition(x, y, z);
|
|
|
|
|
GetCaster()->CastSpell(x, y, z, SPELL_MAGE_FLAMESTRIKE, true);
|
|
|
|
|
}
|
2010-12-30 02:03:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
2012-12-26 18:03:41 +01:00
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_blast_wave_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
|
|
|
|
|
AfterCast += SpellCastFn(spell_mage_blast_wave_SpellScript::HandleImprovedFlamestrike);
|
2010-12-30 02:03:46 +01:00
|
|
|
}
|
2012-12-26 18:03:41 +01:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
uint32 _targetCount;
|
2010-12-30 02:03:46 +01:00
|
|
|
};
|
|
|
|
|
|
2011-09-15 14:08:17 +02:00
|
|
|
SpellScript* GetSpellScript() const
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
|
|
|
|
return new spell_mage_blast_wave_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-24 00:10:49 +02:00
|
|
|
class spell_mage_cold_snap : public SpellScriptLoader
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2010-08-06 11:35:39 -07:00
|
|
|
public:
|
2010-08-24 00:10:49 +02:00
|
|
|
spell_mage_cold_snap() : SpellScriptLoader("spell_mage_cold_snap") { }
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-08-06 11:35:39 -07:00
|
|
|
class spell_mage_cold_snap_SpellScript : public SpellScript
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
PrepareSpellScript(spell_mage_cold_snap_SpellScript);
|
2010-08-06 11:35:39 -07:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
bool Load()
|
|
|
|
|
{
|
|
|
|
|
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
|
|
|
|
}
|
2010-08-06 11:35:39 -07:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
2012-02-18 16:52:08 +01:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
Player* caster = GetCaster()->ToPlayer();
|
2010-08-06 11:35:39 -07:00
|
|
|
// immediately finishes the cooldown on Frost spells
|
2012-02-18 12:12:49 +01:00
|
|
|
const SpellCooldowns& cm = caster->GetSpellCooldownMap();
|
2010-08-06 11:35:39 -07:00
|
|
|
for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();)
|
|
|
|
|
{
|
2011-09-15 14:08:17 +02:00
|
|
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
2010-08-06 11:35:39 -07:00
|
|
|
|
|
|
|
|
if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE &&
|
2011-07-26 23:09:28 +02:00
|
|
|
(spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) &&
|
|
|
|
|
spellInfo->Id != SPELL_MAGE_COLD_SNAP && spellInfo->GetRecoveryTime() > 0)
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
caster->RemoveSpellCooldown((itr++)->first, true);
|
2010-08-06 11:35:39 -07:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
++itr;
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-08-06 11:35:39 -07:00
|
|
|
void Register()
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2010-08-06 11:35:39 -07:00
|
|
|
// add dummy effect spell handler to Cold Snap
|
2011-09-25 13:29:17 +02:00
|
|
|
OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
2010-07-26 19:05:20 -07:00
|
|
|
}
|
2010-08-06 11:35:39 -07:00
|
|
|
};
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-08-06 11:35:39 -07:00
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_cold_snap_SpellScript();
|
|
|
|
|
}
|
2010-07-26 19:05:20 -07:00
|
|
|
};
|
|
|
|
|
|
2012-03-06 22:05:33 +01:00
|
|
|
enum SilvermoonPolymorph
|
|
|
|
|
{
|
|
|
|
|
NPC_AUROSALIA = 18744,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// TODO: move out of here and rename - not a mage spell
|
2010-08-24 00:10:49 +02:00
|
|
|
class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2010-08-06 11:35:39 -07:00
|
|
|
public:
|
2010-08-24 00:10:49 +02:00
|
|
|
spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { }
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-08-06 11:35:39 -07:00
|
|
|
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
|
|
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
|
|
|
|
|
|
2012-03-06 22:05:33 +01:00
|
|
|
static const uint32 PolymorhForms[6];
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2011-07-26 23:09:28 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
|
|
|
|
// check if spell ids exist in dbc
|
2012-03-06 22:05:33 +01:00
|
|
|
for (uint32 i = 0; i < 6; i++)
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
|
2010-08-06 11:35:39 -07:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2010-07-27 21:12:40 -07:00
|
|
|
|
2010-08-23 14:10:24 +02:00
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
2012-03-06 22:05:33 +01:00
|
|
|
if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
|
|
|
|
|
if (target->GetTypeId() == TYPEID_UNIT)
|
|
|
|
|
target->CastSpell(target, PolymorhForms[urand(0, 5)], true);
|
2010-08-06 11:35:39 -07:00
|
|
|
}
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-08-06 11:35:39 -07:00
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
// add dummy effect spell handler to Polymorph visual
|
2011-09-25 13:29:17 +02:00
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
2010-08-06 11:35:39 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2010-08-06 11:35:39 -07:00
|
|
|
return new spell_mage_polymorph_cast_visual_SpellScript();
|
2010-07-26 19:05:20 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-03-06 22:05:33 +01:00
|
|
|
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] =
|
2010-08-07 01:02:09 +06:00
|
|
|
{
|
|
|
|
|
SPELL_MAGE_SQUIRREL_FORM,
|
|
|
|
|
SPELL_MAGE_GIRAFFE_FORM,
|
|
|
|
|
SPELL_MAGE_SERPENT_FORM,
|
|
|
|
|
SPELL_MAGE_DRAGONHAWK_FORM,
|
|
|
|
|
SPELL_MAGE_WORGEN_FORM,
|
|
|
|
|
SPELL_MAGE_SHEEP_FORM
|
|
|
|
|
};
|
|
|
|
|
|
2010-08-24 00:10:49 +02:00
|
|
|
class spell_mage_summon_water_elemental : public SpellScriptLoader
|
2010-07-26 19:05:20 -07:00
|
|
|
{
|
2010-08-06 11:35:39 -07:00
|
|
|
public:
|
2010-08-24 00:10:49 +02:00
|
|
|
spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { }
|
2010-08-06 11:35:39 -07:00
|
|
|
|
|
|
|
|
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
|
|
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript);
|
|
|
|
|
|
2011-07-26 23:09:28 +02:00
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT))
|
2010-08-06 11:35:39 -07:00
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-23 14:10:24 +02:00
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
2011-09-25 13:29:17 +02:00
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
// Glyph of Eternal Water
|
|
|
|
|
if (caster->HasAura(SPELL_MAGE_GLYPH_OF_ETERNAL_WATER))
|
|
|
|
|
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_PERMANENT, true);
|
|
|
|
|
else
|
|
|
|
|
caster->CastSpell(caster, SPELL_MAGE_SUMMON_WATER_ELEMENTAL_TEMPORARY, true);
|
2010-08-06 11:35:39 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
// add dummy effect spell handler to Summon Water Elemental
|
2011-09-25 13:29:17 +02:00
|
|
|
OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
2010-08-06 11:35:39 -07:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2011-09-15 14:08:17 +02:00
|
|
|
SpellScript* GetSpellScript() const
|
2010-08-06 11:35:39 -07:00
|
|
|
{
|
|
|
|
|
return new spell_mage_summon_water_elemental_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
2010-07-26 19:05:20 -07:00
|
|
|
|
2010-12-30 19:05:19 +01:00
|
|
|
// Frost Warding
|
2010-12-30 02:03:46 +01:00
|
|
|
class spell_mage_frost_warding_trigger : public SpellScriptLoader
|
2010-09-28 09:11:41 +03:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
public:
|
|
|
|
|
spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { }
|
2010-12-30 02:03:46 +01:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
class spell_mage_frost_warding_trigger_AuraScript : public AuraScript
|
2010-09-28 09:11:41 +03:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript);
|
2010-09-28 09:11:41 +03:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
enum Spells
|
|
|
|
|
{
|
|
|
|
|
SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776,
|
|
|
|
|
SPELL_MAGE_FROST_WARDING_R1 = 28332,
|
|
|
|
|
};
|
2010-09-28 09:11:41 +03:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
2010-09-28 09:11:41 +03:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2010-12-30 02:03:46 +01:00
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
|
|
|
|
{
|
|
|
|
|
Unit* target = GetTarget();
|
|
|
|
|
if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0))
|
2010-12-30 02:03:46 +01:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue();
|
|
|
|
|
|
|
|
|
|
if (roll_chance_i(chance))
|
|
|
|
|
{
|
2012-04-07 18:25:34 -05:00
|
|
|
int32 bp = dmgInfo.GetDamage();
|
|
|
|
|
dmgInfo.AbsorbDamage(bp);
|
2012-02-18 12:12:49 +01:00
|
|
|
target->CastCustomSpell(target, SPELL_MAGE_FROST_WARDING_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff);
|
2012-04-07 18:25:34 -05:00
|
|
|
absorbAmount = 0;
|
|
|
|
|
PreventDefaultAction();
|
2012-02-18 12:12:49 +01:00
|
|
|
}
|
2010-12-30 02:03:46 +01:00
|
|
|
}
|
2010-09-28 09:11:41 +03:00
|
|
|
}
|
|
|
|
|
|
2012-02-18 12:12:49 +01:00
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript* GetAuraScript() const
|
2010-09-28 09:11:41 +03:00
|
|
|
{
|
2012-02-18 12:12:49 +01:00
|
|
|
return new spell_mage_frost_warding_trigger_AuraScript();
|
2010-09-28 09:11:41 +03:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-05-28 04:07:51 +02:00
|
|
|
class spell_mage_living_bomb : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_living_bomb_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_mage_living_bomb_AuraScript);
|
|
|
|
|
|
|
|
|
|
bool Validate(SpellInfo const* spell)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue())))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
|
|
|
|
|
if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (Unit* caster = GetCaster())
|
|
|
|
|
caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript* GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_living_bomb_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-11-17 14:10:47 -05:00
|
|
|
enum ConeOfColdSpells
|
|
|
|
|
{
|
|
|
|
|
SPELL_CONE_OF_COLD_AURA_R1 = 11190, // Improved Cone of Cold Rank 1 aura
|
|
|
|
|
SPELL_CONE_OF_COLD_AURA_R2 = 12489, // Improved Cone of Cold Rank 2 aura
|
|
|
|
|
SPELL_CONE_OF_COLD_TRIGGER_R1 = 83301, // Improved Cone of Cold Rank 1 Trigger
|
|
|
|
|
SPELL_CONE_OF_COLD_TRIGGER_R2 = 83302, // Improved Cone of Cold Rank 2 Trigger
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 120 Cone of Cold
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_cone_of_cold : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_cone_of_cold() : SpellScriptLoader("spell_mage_cone_of_cold") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_cone_of_cold_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_cone_of_cold_SpellScript);
|
|
|
|
|
|
2012-11-19 10:09:58 +01:00
|
|
|
void HandleConeOfColdScript(SpellEffIndex /*effIndex*/)
|
2012-11-17 14:10:47 -05:00
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (Unit* unitTarget = GetHitUnit())
|
|
|
|
|
{
|
|
|
|
|
if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R1)) // Improved Cone of Cold Rank 1
|
|
|
|
|
unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R1, true);
|
|
|
|
|
else if (caster->HasAura(SPELL_CONE_OF_COLD_AURA_R2)) // Improved Cone of Cold Rank 2
|
|
|
|
|
unitTarget->CastSpell(unitTarget, SPELL_CONE_OF_COLD_TRIGGER_R2, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_mage_cone_of_cold_SpellScript::HandleConeOfColdScript, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_cone_of_cold_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-12-26 18:03:41 +01:00
|
|
|
// 42955 Conjure Refreshment
|
|
|
|
|
/// Updated 4.3.4
|
2012-12-01 14:58:56 +01:00
|
|
|
struct ConjureRefreshmentData
|
|
|
|
|
{
|
|
|
|
|
uint32 minLevel;
|
|
|
|
|
uint32 maxLevel;
|
|
|
|
|
uint32 spellId;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uint8 const MAX_CONJURE_REFRESHMENT_SPELLS = 7;
|
|
|
|
|
const ConjureRefreshmentData _conjureData[MAX_CONJURE_REFRESHMENT_SPELLS] =
|
|
|
|
|
{
|
|
|
|
|
{ 33, 43, 92739 },
|
|
|
|
|
{ 44, 53, 92799 },
|
|
|
|
|
{ 54, 63, 92802 },
|
|
|
|
|
{ 64, 73, 92805 },
|
|
|
|
|
{ 74, 79, 74625 },
|
|
|
|
|
{ 80, 84, 92822 },
|
|
|
|
|
{ 85, 85, 92727 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class spell_mage_conjure_refreshment : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_conjure_refreshment() : SpellScriptLoader("spell_mage_conjure_refreshment") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_conjure_refreshment_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_conjure_refreshment_SpellScript);
|
|
|
|
|
|
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(_conjureData[i].spellId))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Load()
|
|
|
|
|
{
|
|
|
|
|
if (GetCaster()->GetTypeId() != TYPEID_PLAYER)
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
|
|
|
|
{
|
|
|
|
|
uint8 level = GetHitUnit()->getLevel();
|
|
|
|
|
for (uint8 i = 0; i < MAX_CONJURE_REFRESHMENT_SPELLS; ++i)
|
|
|
|
|
{
|
|
|
|
|
ConjureRefreshmentData const& spellData = _conjureData[i];
|
|
|
|
|
if (level < spellData.minLevel || level > spellData.maxLevel)
|
|
|
|
|
continue;
|
|
|
|
|
GetHitUnit()->CastSpell(GetHitUnit(), spellData.spellId);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_mage_conjure_refreshment_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_conjure_refreshment_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2012-12-26 18:03:41 +01:00
|
|
|
// 42208 Blizzard
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_blizzard : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_blizzard() : SpellScriptLoader("spell_mage_blizzard") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_blizzard_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_blizzard_SpellScript);
|
|
|
|
|
|
2012-12-26 18:30:37 +01:00
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R1))
|
|
|
|
|
return false;
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_CHILLED_R2))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AddChillEffect(SpellEffIndex /*effIndex*/)
|
2012-12-26 18:03:41 +01:00
|
|
|
{
|
|
|
|
|
Unit* caster = GetCaster();
|
|
|
|
|
if (Unit* unitTarget = GetHitUnit())
|
|
|
|
|
{
|
|
|
|
|
if (caster->IsScriptOverriden(GetSpellInfo(), 836))
|
|
|
|
|
caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R1, true);
|
|
|
|
|
else if (caster->IsScriptOverriden(GetSpellInfo(), 988))
|
|
|
|
|
caster->CastSpell(unitTarget, SPELL_MAGE_CHILLED_R2, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_mage_blizzard_SpellScript::AddChillEffect, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript *GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_blizzard_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 116 Frostbolt
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_frostbolt : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_frostbolt() : SpellScriptLoader("spell_mage_frostbolt") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_frostbolt_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_frostbolt_SpellScript);
|
|
|
|
|
|
2012-12-26 18:30:37 +01:00
|
|
|
void RecalculateDamage(SpellEffIndex /*effIndex*/)
|
2012-12-26 18:03:41 +01:00
|
|
|
{
|
|
|
|
|
if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster()))
|
|
|
|
|
{
|
|
|
|
|
if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_SHATTER, EFFECT_1))
|
|
|
|
|
{
|
|
|
|
|
int32 damage = GetHitDamage();
|
|
|
|
|
AddPct(damage, aurEff->GetAmount());
|
|
|
|
|
SetHitDamage(damage);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnEffectHitTarget += SpellEffectFn(spell_mage_frostbolt_SpellScript::RecalculateDamage, EFFECT_1, SPELL_EFFECT_SCHOOL_DAMAGE);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript *GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_frostbolt_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 11426 Ice Barrier
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_ice_barrier : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_ice_barrier() : SpellScriptLoader("spell_mage_ice_barrier") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_ice_barrier_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_mage_ice_barrier_AuraScript);
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (GetTarget()->HasAura(SPELL_MAGE_SHATTERED_BARRIER_R1))
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R1, true);
|
|
|
|
|
else if (GetTarget()->HasAura(SPELL_MAGE_SHATTERED_BARRIER_R2))
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_SHATTERED_BARRIER_FREEZE_R2, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_ice_barrier_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript* GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_ice_barrier_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 1463 Mana Shield
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_mana_shield : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_mana_shield() : SpellScriptLoader("spell_mage_mana_shield") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_mana_shield_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
|
|
|
|
|
|
|
|
|
|
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
|
|
|
|
{
|
|
|
|
|
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
|
|
|
|
{
|
|
|
|
|
int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount());
|
|
|
|
|
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
|
|
|
|
{
|
|
|
|
|
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL)
|
|
|
|
|
GetTarget()->CastSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_KNOCKBACK, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::HandleAbsorb, EFFECT_0);
|
|
|
|
|
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_mana_shield_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_MANA_SHIELD, AURA_EFFECT_HANDLE_REAL);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript* GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_mana_shield_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 543 Mage Ward
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_mage_ward : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_mage_ward() : SpellScriptLoader("spell_mage_mage_ward") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_mage_ward_AuraScript : public AuraScript
|
|
|
|
|
{
|
|
|
|
|
PrepareAuraScript(spell_mage_mage_ward_AuraScript);
|
|
|
|
|
|
|
|
|
|
void HandleAbsorb(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount)
|
|
|
|
|
{
|
|
|
|
|
if (AuraEffect* aurEff = GetTarget()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, ICON_MAGE_INCANTER_S_ABSORPTION, EFFECT_0))
|
|
|
|
|
{
|
|
|
|
|
int32 bp = CalculatePct(absorbAmount, aurEff->GetAmount());
|
|
|
|
|
GetTarget()->CastCustomSpell(GetTarget(), SPELL_MAGE_INCANTER_S_ABSORPTION_TRIGGERED, &bp, NULL, NULL, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_mage_ward_AuraScript::HandleAbsorb, EFFECT_0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
AuraScript* GetAuraScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_mage_ward_AuraScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 5405 Replenish Mana (Mana Gem)
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_replenish_mana : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_replenish_mana() : SpellScriptLoader("spell_mage_replenish_mana") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_replenish_mana_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_replenish_mana_SpellScript);
|
|
|
|
|
|
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleImprovedManaGem()
|
|
|
|
|
{
|
|
|
|
|
if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_MANA_GEM, EFFECT_0))
|
|
|
|
|
{
|
|
|
|
|
int32 bp = CalculatePct(GetCaster()->GetMaxPower(POWER_MANA), aurEff->GetAmount());
|
|
|
|
|
GetCaster()->CastCustomSpell(GetCaster(), SPELL_MAGE_IMPROVED_MANA_GEM_TRIGGERED, &bp, &bp, NULL, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
AfterCast += SpellCastFn(spell_mage_replenish_mana_SpellScript::HandleImprovedManaGem);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_replenish_mana_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// 33395 Water Elemental's Freeze
|
|
|
|
|
/// Updated 4.3.4
|
|
|
|
|
class spell_mage_water_elemental_freeze : public SpellScriptLoader
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
spell_mage_water_elemental_freeze() : SpellScriptLoader("spell_mage_water_elemental_freeze") { }
|
|
|
|
|
|
|
|
|
|
class spell_mage_water_elemental_freeze_SpellScript : public SpellScript
|
|
|
|
|
{
|
|
|
|
|
PrepareSpellScript(spell_mage_water_elemental_freeze_SpellScript);
|
|
|
|
|
|
|
|
|
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
|
|
|
|
{
|
|
|
|
|
if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FINGERS_OF_FROST))
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CountTargets(std::list<WorldObject*>& targetList)
|
|
|
|
|
{
|
|
|
|
|
_didHit = !targetList.empty();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void HandleImprovedFreeze()
|
|
|
|
|
{
|
|
|
|
|
if (!_didHit)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Unit* owner = GetCaster()->GetOwner();
|
|
|
|
|
if (!owner)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (AuraEffect* aurEff = owner->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_IMPROVED_FREEZE, EFFECT_0))
|
|
|
|
|
{
|
|
|
|
|
if (roll_chance_i(aurEff->GetAmount()))
|
|
|
|
|
owner->CastCustomSpell(SPELL_MAGE_FINGERS_OF_FROST, SPELLVALUE_AURA_STACK, 2, owner, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Register()
|
|
|
|
|
{
|
|
|
|
|
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mage_water_elemental_freeze_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
|
|
|
|
|
AfterCast += SpellCastFn(spell_mage_water_elemental_freeze_SpellScript::HandleImprovedFreeze);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool _didHit;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SpellScript* GetSpellScript() const
|
|
|
|
|
{
|
|
|
|
|
return new spell_mage_water_elemental_freeze_SpellScript();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2010-07-24 22:41:42 +02:00
|
|
|
void AddSC_mage_spell_scripts()
|
|
|
|
|
{
|
2012-05-28 04:07:51 +02:00
|
|
|
new spell_mage_blast_wave();
|
|
|
|
|
new spell_mage_cold_snap();
|
2012-12-07 17:29:31 +01:00
|
|
|
new spell_mage_cone_of_cold();
|
|
|
|
|
new spell_mage_conjure_refreshment();
|
2010-12-30 02:03:46 +01:00
|
|
|
new spell_mage_frost_warding_trigger();
|
2012-05-28 04:07:51 +02:00
|
|
|
new spell_mage_polymorph_cast_visual();
|
|
|
|
|
new spell_mage_summon_water_elemental();
|
|
|
|
|
new spell_mage_living_bomb();
|
2012-12-26 18:03:41 +01:00
|
|
|
new spell_mage_blizzard();
|
|
|
|
|
new spell_mage_frostbolt();
|
|
|
|
|
new spell_mage_ice_barrier();
|
|
|
|
|
new spell_mage_mana_shield();
|
|
|
|
|
new spell_mage_mage_ward();
|
|
|
|
|
new spell_mage_replenish_mana();
|
|
|
|
|
new spell_mage_water_elemental_freeze();
|
2010-08-06 19:46:02 +02:00
|
|
|
}
|