refactor(Scripts/Spells): convert spell_mage into new system (#9058)

This commit is contained in:
Kitzunu
2021-11-09 11:44:37 +01:00
committed by GitHub
parent af02a8990a
commit ef0bbc4c7b
2 changed files with 611 additions and 839 deletions
@@ -0,0 +1,5 @@
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1636371600934152600');
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_mage_polymorph_visual';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(32826,'spell_mage_polymorph_cast_visual');
+132 -365
View File
@@ -57,15 +57,9 @@ enum MageSpells
SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126,
}; };
// Ours class spell_mage_arcane_blast : public SpellScript
class spell_mage_arcane_blast : public SpellScriptLoader
{ {
public: PrepareSpellScript(spell_mage_arcane_blast);
spell_mage_arcane_blast() : SpellScriptLoader("spell_mage_arcane_blast") { }
class spell_mage_arcane_blast_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_arcane_blast_SpellScript);
bool Load() override { _triggerSpellId = 0; return true; } bool Load() override { _triggerSpellId = 0; return true; }
@@ -82,29 +76,18 @@ public:
void Register() override void Register() override
{ {
OnEffectLaunch += SpellEffectFn(spell_mage_arcane_blast_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); OnEffectLaunch += SpellEffectFn(spell_mage_arcane_blast::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
OnEffectLaunchTarget += SpellEffectFn(spell_mage_arcane_blast_SpellScript::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); OnEffectLaunchTarget += SpellEffectFn(spell_mage_arcane_blast::HandleTriggerSpell, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL);
AfterCast += SpellCastFn(spell_mage_arcane_blast_SpellScript::HandleAfterCast); AfterCast += SpellCastFn(spell_mage_arcane_blast::HandleAfterCast);
} }
private: private:
uint32 _triggerSpellId; uint32 _triggerSpellId;
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_arcane_blast_SpellScript();
}
}; };
class spell_mage_deep_freeze : public SpellScriptLoader class spell_mage_deep_freeze : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_deep_freeze)
spell_mage_deep_freeze() : SpellScriptLoader("spell_mage_deep_freeze") { }
class spell_mage_deep_freeze_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_deep_freeze_SpellScript)
void HandleOnHit() void HandleOnHit()
{ {
@@ -117,24 +100,13 @@ public:
void Register() override void Register() override
{ {
OnHit += SpellHitFn(spell_mage_deep_freeze_SpellScript::HandleOnHit); OnHit += SpellHitFn(spell_mage_deep_freeze::HandleOnHit);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_deep_freeze_SpellScript();
} }
}; };
class spell_mage_burning_determination : public SpellScriptLoader class spell_mage_burning_determination : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_burning_determination);
spell_mage_burning_determination() : SpellScriptLoader("spell_mage_burning_determination") { }
class spell_mage_burning_determination_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_burning_determination_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo) bool CheckProc(ProcEventInfo& eventInfo)
{ {
@@ -169,25 +141,14 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_burning_determination_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_burning_determination::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_burning_determination_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); OnEffectProc += AuraEffectProcFn(spell_mage_burning_determination::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_burning_determination_AuraScript();
} }
}; };
class spell_mage_molten_armor : public SpellScriptLoader class spell_mage_molten_armor : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_molten_armor);
spell_mage_molten_armor() : SpellScriptLoader("spell_mage_molten_armor") { }
class spell_mage_molten_armor_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_molten_armor_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo) bool CheckProc(ProcEventInfo& eventInfo)
{ {
@@ -204,24 +165,13 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_molten_armor_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_molten_armor::CheckProc);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_molten_armor_AuraScript();
} }
}; };
class spell_mage_mirror_image : public SpellScriptLoader class spell_mage_mirror_image : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_mirror_image)
spell_mage_mirror_image() : SpellScriptLoader("spell_mage_mirror_image") { }
class spell_mage_mirror_image_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_mirror_image_AuraScript)
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{ {
@@ -235,25 +185,14 @@ public:
void Register() override void Register() override
{ {
OnEffectApply += AuraEffectApplyFn(spell_mage_mirror_image_AuraScript::HandleEffectApply, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectApply += AuraEffectApplyFn(spell_mage_mirror_image::HandleEffectApply, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_mage_mirror_image_AuraScript::CalcPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY); DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_mage_mirror_image::CalcPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_mirror_image_AuraScript();
} }
}; };
class spell_mage_burnout : public SpellScriptLoader class spell_mage_burnout : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_burnout);
spell_mage_burnout() : SpellScriptLoader("spell_mage_burnout") { }
class spell_mage_burnout_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_burnout_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -277,25 +216,14 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_burnout_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_burnout::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_burnout_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_mage_burnout::HandleProc, EFFECT_1, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_burnout_AuraScript();
} }
}; };
class spell_mage_burnout_trigger : public SpellScriptLoader class spell_mage_burnout_trigger : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_burnout_trigger);
spell_mage_burnout_trigger() : SpellScriptLoader("spell_mage_burnout_trigger") { }
class spell_mage_burnout_trigger_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_burnout_trigger_SpellScript);
void HandleDummy(SpellEffIndex effIndex) void HandleDummy(SpellEffIndex effIndex)
{ {
@@ -309,24 +237,13 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_mage_burnout_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_POWER_BURN); OnEffectHitTarget += SpellEffectFn(spell_mage_burnout_trigger::HandleDummy, EFFECT_0, SPELL_EFFECT_POWER_BURN);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_burnout_trigger_SpellScript();
} }
}; };
class spell_mage_pet_scaling : public SpellScriptLoader class spell_mage_pet_scaling : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_pet_scaling);
spell_mage_pet_scaling() : SpellScriptLoader("spell_mage_pet_scaling") { }
class spell_mage_pet_scaling_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_pet_scaling_AuraScript);
void CalculateResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) void CalculateResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
{ {
@@ -419,37 +336,26 @@ public:
void Register() override void Register() override
{ {
if (m_scriptSpellId != 35657) if (m_scriptSpellId != 35657)
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling_AuraScript::CalculateResistanceAmount, EFFECT_ALL, SPELL_AURA_MOD_RESISTANCE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling::CalculateResistanceAmount, EFFECT_ALL, SPELL_AURA_MOD_RESISTANCE);
if (m_scriptSpellId == 35657 || m_scriptSpellId == 35658) if (m_scriptSpellId == 35657 || m_scriptSpellId == 35658)
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling_AuraScript::CalculateStatAmount, EFFECT_ALL, SPELL_AURA_MOD_STAT); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling::CalculateStatAmount, EFFECT_ALL, SPELL_AURA_MOD_STAT);
if (m_scriptSpellId == 35657) if (m_scriptSpellId == 35657)
{ {
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling_AuraScript::CalculateAPAmount, EFFECT_ALL, SPELL_AURA_MOD_ATTACK_POWER); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling::CalculateAPAmount, EFFECT_ALL, SPELL_AURA_MOD_ATTACK_POWER);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling_AuraScript::CalculateSPAmount, EFFECT_ALL, SPELL_AURA_MOD_DAMAGE_DONE); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_pet_scaling::CalculateSPAmount, EFFECT_ALL, SPELL_AURA_MOD_DAMAGE_DONE);
} }
OnEffectApply += AuraEffectApplyFn(spell_mage_pet_scaling_AuraScript::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL); OnEffectApply += AuraEffectApplyFn(spell_mage_pet_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_mage_pet_scaling_AuraScript::CalcPeriodic, EFFECT_ALL, SPELL_AURA_ANY); DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_mage_pet_scaling::CalcPeriodic, EFFECT_ALL, SPELL_AURA_ANY);
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_pet_scaling_AuraScript::HandlePeriodic, EFFECT_ALL, SPELL_AURA_ANY); OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_pet_scaling::HandlePeriodic, EFFECT_ALL, SPELL_AURA_ANY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_pet_scaling_AuraScript();
} }
}; };
class spell_mage_brain_freeze : public SpellScriptLoader class spell_mage_brain_freeze : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_brain_freeze);
spell_mage_brain_freeze() : SpellScriptLoader("spell_mage_brain_freeze") { }
class spell_mage_brain_freeze_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_brain_freeze_AuraScript);
bool CheckProc(ProcEventInfo& eventInfo) bool CheckProc(ProcEventInfo& eventInfo)
{ {
@@ -466,24 +372,13 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_brain_freeze_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_brain_freeze::CheckProc);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_brain_freeze_AuraScript();
} }
}; };
class spell_mage_glyph_of_eternal_water : public SpellScriptLoader class spell_mage_glyph_of_eternal_water : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_glyph_of_eternal_water);
spell_mage_glyph_of_eternal_water() : SpellScriptLoader("spell_mage_glyph_of_eternal_water") { }
class spell_mage_glyph_of_eternal_water_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_glyph_of_eternal_water_AuraScript);
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{ {
@@ -496,24 +391,13 @@ public:
void Register() override void Register() override
{ {
OnEffectRemove += AuraEffectRemoveFn(spell_mage_glyph_of_eternal_water_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); OnEffectRemove += AuraEffectRemoveFn(spell_mage_glyph_of_eternal_water::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_glyph_of_eternal_water_AuraScript();
} }
}; };
class spell_mage_combustion_proc : public SpellScriptLoader class spell_mage_combustion_proc : public AuraScript
{
public:
spell_mage_combustion_proc() : SpellScriptLoader("spell_mage_combustion_proc") {}
class spell_mage_combustion_proc_AuraScript : public AuraScript
{ {
PrepareAuraScript(spell_mage_combustion_proc_AuraScript); PrepareAuraScript(spell_mage_combustion_proc);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -527,17 +411,10 @@ public:
void Register() override void Register() override
{ {
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_combustion_proc_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL); AfterEffectRemove += AuraEffectRemoveFn(spell_mage_combustion_proc::OnRemove, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
} }
}; };
AuraScript* GetAuraScript() const override
{
return new spell_mage_combustion_proc_AuraScript();
}
};
// Theirs
// Incanter's Absorbtion // Incanter's Absorbtion
class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript
{ {
@@ -567,14 +444,9 @@ public:
}; };
// -11113 - Blast Wave // -11113 - Blast Wave
class spell_mage_blast_wave : public SpellScriptLoader class spell_mage_blast_wave : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_blast_wave);
spell_mage_blast_wave() : SpellScriptLoader("spell_mage_blast_wave") { }
class spell_mage_blast_wave_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_blast_wave_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -589,25 +461,14 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_mage_blast_wave_SpellScript::HandleKnockBack, EFFECT_2, SPELL_EFFECT_KNOCK_BACK); OnEffectHitTarget += SpellEffectFn(spell_mage_blast_wave::HandleKnockBack, EFFECT_2, SPELL_EFFECT_KNOCK_BACK);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_blast_wave_SpellScript();
} }
}; };
// 11958 - Cold Snap // 11958 - Cold Snap
class spell_mage_cold_snap : public SpellScriptLoader class spell_mage_cold_snap : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_cold_snap);
spell_mage_cold_snap() : SpellScriptLoader("spell_mage_cold_snap") { }
class spell_mage_cold_snap_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_cold_snap_SpellScript);
bool Load() override bool Load() override
{ {
@@ -636,26 +497,15 @@ public:
void Register() override void Register() override
{ {
OnEffectHit += SpellEffectFn(spell_mage_cold_snap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHit += SpellEffectFn(spell_mage_cold_snap::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_cold_snap_SpellScript();
} }
}; };
// -543 - Fire Ward // -543 - Fire Ward
// -6143 - Frost Ward // -6143 - Frost Ward
class spell_mage_fire_frost_ward : public SpellScriptLoader class spell_mage_fire_frost_ward : public spell_mage_incanters_absorbtion_base_AuraScript
{ {
public: PrepareAuraScript(spell_mage_fire_frost_ward);
spell_mage_fire_frost_ward() : SpellScriptLoader("spell_mage_fire_frost_ward") { }
class spell_mage_fire_frost_ward_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
PrepareAuraScript(spell_mage_fire_frost_ward_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -705,27 +555,16 @@ public:
void Register() override void Register() override
{ {
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_fire_frost_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_fire_frost_ward::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward_AuraScript::Absorb, EFFECT_0); OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward::Absorb, EFFECT_0);
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward_AuraScript::Trigger, EFFECT_0); AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward::Trigger, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_fire_frost_ward_AuraScript();
} }
}; };
// 54646 - Focus Magic // 54646 - Focus Magic
class spell_mage_focus_magic : public SpellScriptLoader class spell_mage_focus_magic : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_focus_magic);
spell_mage_focus_magic() : SpellScriptLoader("spell_mage_focus_magic") { }
class spell_mage_focus_magic_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_focus_magic_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -752,26 +591,20 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_focus_magic_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_focus_magic::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_focus_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); OnEffectProc += AuraEffectProcFn(spell_mage_focus_magic::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
} }
private: private:
Unit* _procTarget; Unit* _procTarget;
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_focus_magic_AuraScript();
}
}; };
// -11426 - Ice Barrier // -11426 - Ice Barrier
class spell_mage_ice_barrier : public SpellScriptLoader class spell_mage_ice_barrier_aura : public spell_mage_incanters_absorbtion_base_AuraScript
{ {
public: PrepareAuraScript(spell_mage_ice_barrier_aura);
spell_mage_ice_barrier() : SpellScriptLoader("spell_mage_ice_barrier") { }
// TODO: Rework
static int32 CalculateSpellAmount(Unit* caster, int32 amount, const SpellInfo* spellInfo, const AuraEffect* aurEff) static int32 CalculateSpellAmount(Unit* caster, int32 amount, const SpellInfo* spellInfo, const AuraEffect* aurEff)
{ {
// +80.68% from sp bonus // +80.68% from sp bonus
@@ -789,10 +622,6 @@ public:
return amount; return amount;
} }
class spell_mage_ice_barrier_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
PrepareAuraScript(spell_mage_ice_barrier_AuraScript);
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated)
{ {
canBeRecalculated = false; canBeRecalculated = false;
@@ -802,20 +631,33 @@ public:
void Register() override void Register() override
{ {
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_ice_barrier_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_ice_barrier_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_ice_barrier_AuraScript::Trigger, EFFECT_0); AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_ice_barrier_aura::Trigger, EFFECT_0);
} }
}; };
AuraScript* GetAuraScript() const override class spell_mage_ice_barrier : public SpellScript
{
PrepareSpellScript(spell_mage_ice_barrier);
// TODO: Rework
static int32 CalculateSpellAmount(Unit* caster, int32 amount, const SpellInfo* spellInfo, const AuraEffect* aurEff)
{ {
return new spell_mage_ice_barrier_AuraScript(); // +80.68% from sp bonus
float bonus = 0.8068f;
bonus *= caster->SpellBaseDamageBonusDone(spellInfo->GetSchoolMask());
// Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :)
// Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage
bonus = caster->ApplyEffectModifiers(spellInfo, aurEff->GetEffIndex(), bonus);
bonus *= caster->CalculateLevelPenalty(spellInfo);
amount += int32(bonus);
return amount;
} }
class spell_mage_ice_barrier_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_ice_barrier_SpellScript);
SpellCastResult CheckCast() SpellCastResult CheckCast()
{ {
Unit* caster = GetCaster(); Unit* caster = GetCaster();
@@ -834,25 +676,14 @@ public:
void Register() override void Register() override
{ {
OnCheckCast += SpellCheckCastFn(spell_mage_ice_barrier_SpellScript::CheckCast); OnCheckCast += SpellCheckCastFn(spell_mage_ice_barrier::CheckCast);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_ice_barrier_SpellScript;
} }
}; };
// -11119 - Ignite // -11119 - Ignite
class spell_mage_ignite : public SpellScriptLoader class spell_mage_ignite : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_ignite);
spell_mage_ignite() : SpellScriptLoader("spell_mage_ignite") { }
class spell_mage_ignite_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_ignite_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -899,26 +730,15 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_ignite_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_ignite::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_ignite_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_mage_ignite::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_ignite_AuraScript();
} }
}; };
// -44457 - Living Bomb // -44457 - Living Bomb
class spell_mage_living_bomb : public SpellScriptLoader class spell_mage_living_bomb : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_living_bomb);
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) override bool Validate(SpellInfo const* spell) override
{ {
@@ -939,25 +759,14 @@ public:
void Register() override void Register() override
{ {
AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_living_bomb_AuraScript();
} }
}; };
// -1463 - Mana Shield // -1463 - Mana Shield
class spell_mage_mana_shield : public SpellScriptLoader class spell_mage_mana_shield : public spell_mage_incanters_absorbtion_base_AuraScript
{ {
public: PrepareAuraScript(spell_mage_mana_shield);
spell_mage_mana_shield() : SpellScriptLoader("spell_mage_mana_shield") { }
class spell_mage_mana_shield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript
{
PrepareAuraScript(spell_mage_mana_shield_AuraScript);
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{ {
@@ -976,26 +785,15 @@ public:
void Register() override void Register() override
{ {
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mana_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD); DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mana_shield::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD);
AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::Trigger, EFFECT_0); AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield::Trigger, EFFECT_0);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_mana_shield_AuraScript();
} }
}; };
// -29074 - Master of Elements // -29074 - Master of Elements
class spell_mage_master_of_elements : public SpellScriptLoader class spell_mage_master_of_elements : public AuraScript
{ {
public: PrepareAuraScript(spell_mage_master_of_elements);
spell_mage_master_of_elements() : SpellScriptLoader("spell_mage_master_of_elements") { }
class spell_mage_master_of_elements_AuraScript : public AuraScript
{
PrepareAuraScript(spell_mage_master_of_elements_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override bool Validate(SpellInfo const* /*spellInfo*/) override
{ {
@@ -1049,19 +847,13 @@ public:
void Register() override void Register() override
{ {
DoCheckProc += AuraCheckProcFn(spell_mage_master_of_elements_AuraScript::CheckProc); DoCheckProc += AuraCheckProcFn(spell_mage_master_of_elements::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_mage_master_of_elements_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_mage_master_of_elements::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
} }
private: private:
SpellInfo const* _spellInfo = nullptr; SpellInfo const* _spellInfo = nullptr;
uint8 ticksModifier = 1; uint8 ticksModifier = 1;
};
AuraScript* GetAuraScript() const override
{
return new spell_mage_master_of_elements_AuraScript();
}
}; };
enum SilvermoonPolymorph enum SilvermoonPolymorph
@@ -1071,14 +863,9 @@ enum SilvermoonPolymorph
/// @todo move out of here and rename - not a mage spell /// @todo move out of here and rename - not a mage spell
// 32826 - Polymorph (Visual) // 32826 - Polymorph (Visual)
class spell_mage_polymorph_cast_visual : public SpellScriptLoader class spell_mage_polymorph_cast_visual : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_polymorph_cast_visual);
spell_mage_polymorph_cast_visual() : SpellScriptLoader("spell_mage_polymorph_visual") { }
class spell_mage_polymorph_cast_visual_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
static const uint32 PolymorhForms[6]; static const uint32 PolymorhForms[6];
@@ -1100,17 +887,11 @@ public:
void Register() override void Register() override
{ {
OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHitTarget += SpellEffectFn(spell_mage_polymorph_cast_visual::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_polymorph_cast_visual_SpellScript();
} }
}; };
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] = const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual::PolymorhForms[6] =
{ {
SPELL_MAGE_SQUIRREL_FORM, SPELL_MAGE_SQUIRREL_FORM,
SPELL_MAGE_GIRAFFE_FORM, SPELL_MAGE_GIRAFFE_FORM,
@@ -1121,14 +902,9 @@ const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_
}; };
// 31687 - Summon Water Elemental // 31687 - Summon Water Elemental
class spell_mage_summon_water_elemental : public SpellScriptLoader class spell_mage_summon_water_elemental : public SpellScript
{ {
public: PrepareSpellScript(spell_mage_summon_water_elemental)
spell_mage_summon_water_elemental() : SpellScriptLoader("spell_mage_summon_water_elemental") { }
class spell_mage_summon_water_elemental_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_summon_water_elemental_SpellScript)
bool Validate(SpellInfo const* /*spellEntry*/) override bool Validate(SpellInfo const* /*spellEntry*/) override
{ {
return ValidateSpellInfo( return ValidateSpellInfo(
@@ -1166,41 +942,32 @@ public:
void Register() override void Register() override
{ {
OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); OnEffectHit += SpellEffectFn(spell_mage_summon_water_elemental::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_mage_summon_water_elemental_SpellScript();
} }
}; };
void AddSC_mage_spell_scripts() void AddSC_mage_spell_scripts()
{ {
// Ours RegisterSpellScript(spell_mage_arcane_blast);
new spell_mage_arcane_blast(); RegisterSpellScript(spell_mage_deep_freeze);
new spell_mage_deep_freeze(); RegisterSpellScript(spell_mage_burning_determination);
new spell_mage_burning_determination(); RegisterSpellScript(spell_mage_molten_armor);
new spell_mage_molten_armor(); RegisterSpellScript(spell_mage_mirror_image);
new spell_mage_mirror_image(); RegisterSpellScript(spell_mage_burnout);
new spell_mage_burnout(); RegisterSpellScript(spell_mage_burnout_trigger);
new spell_mage_burnout_trigger(); RegisterSpellScript(spell_mage_pet_scaling);
new spell_mage_pet_scaling(); RegisterSpellScript(spell_mage_brain_freeze);
new spell_mage_brain_freeze(); RegisterSpellScript(spell_mage_glyph_of_eternal_water);
new spell_mage_glyph_of_eternal_water(); RegisterSpellScript(spell_mage_combustion_proc);
new spell_mage_combustion_proc(); RegisterSpellScript(spell_mage_blast_wave);
RegisterSpellScript(spell_mage_cold_snap);
// Theirs RegisterSpellScript(spell_mage_fire_frost_ward);
new spell_mage_blast_wave(); RegisterSpellScript(spell_mage_focus_magic);
new spell_mage_cold_snap(); RegisterSpellScript(spell_mage_ice_barrier);
new spell_mage_fire_frost_ward(); RegisterSpellScript(spell_mage_ignite);
new spell_mage_focus_magic(); RegisterSpellScript(spell_mage_living_bomb);
new spell_mage_ice_barrier(); RegisterSpellScript(spell_mage_mana_shield);
new spell_mage_ignite(); RegisterSpellScript(spell_mage_master_of_elements);
new spell_mage_living_bomb(); RegisterSpellScript(spell_mage_polymorph_cast_visual);
new spell_mage_mana_shield(); RegisterSpellScript(spell_mage_summon_water_elemental);
new spell_mage_master_of_elements();
new spell_mage_polymorph_cast_visual();
new spell_mage_summon_water_elemental();
} }