diff options
-rw-r--r-- | sql/updates/world/master/2022_01_12_03_world_mage_firestarter.sql | 5 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 50 |
2 files changed, 55 insertions, 0 deletions
diff --git a/sql/updates/world/master/2022_01_12_03_world_mage_firestarter.sql b/sql/updates/world/master/2022_01_12_03_world_mage_firestarter.sql new file mode 100644 index 00000000000..8259a3d6f0d --- /dev/null +++ b/sql/updates/world/master/2022_01_12_03_world_mage_firestarter.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_mage_firestarter','spell_mage_firestarter_dots'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(133, 'spell_mage_firestarter'), +(11366, 'spell_mage_firestarter'), +(321712, 'spell_mage_firestarter_dots'); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index d56ee711aee..848e72d7d27 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -51,6 +51,7 @@ enum MageSpells SPELL_MAGE_DRAGONHAWK_FORM = 32818, SPELL_MAGE_EVERWARM_SOCKS = 320913, SPELL_MAGE_FINGERS_OF_FROST = 44544, + SPELL_MAGE_FIRESTARTER = 205026, SPELL_MAGE_FROST_NOVA = 122, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_ICE_BARRIER = 11426, @@ -516,6 +517,53 @@ class spell_mage_fingers_of_frost : public AuraScript } }; +// 133 - Fireball +// 11366 - Pyroblast +class spell_mage_firestarter : public SpellScript +{ + PrepareSpellScript(spell_mage_firestarter); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_FIRESTARTER }); + } + + void CalcCritChance(Unit const* victim, float& critChance) + { + if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_MAGE_FIRESTARTER, EFFECT_0)) + if (victim->GetHealthPct() >= aurEff->GetAmount()) + critChance = 100.0f; + } + + void Register() override + { + OnCalcCritChance += SpellOnCalcCritChanceFn(spell_mage_firestarter::CalcCritChance); + } +}; + +// 321712 - Pyroblast +class spell_mage_firestarter_dots : public AuraScript +{ + PrepareAuraScript(spell_mage_firestarter_dots); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MAGE_FIRESTARTER }); + } + + void CalcCritChance(AuraEffect const* aurEff, Unit const* victim, float& critChance) + { + if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_MAGE_FIRESTARTER, EFFECT_0)) + if (victim->GetHealthPct() >= aurEff->GetAmount()) + critChance = 100.0f; + } + + void Register() override + { + DoEffectCalcCritChance += AuraEffectCalcCritChanceFn(spell_mage_firestarter_dots::CalcCritChance, EFFECT_ALL, SPELL_AURA_PERIODIC_DAMAGE); + } +}; + // 11426 - Ice Barrier class spell_mage_ice_barrier : public AuraScript { @@ -1155,6 +1203,8 @@ void AddSC_mage_spell_scripts() RegisterSpellScript(spell_mage_cone_of_cold); RegisterSpellScript(spell_mage_conjure_refreshment); RegisterAuraScript(spell_mage_fingers_of_frost); + RegisterSpellScript(spell_mage_firestarter); + RegisterAuraScript(spell_mage_firestarter_dots); RegisterAuraScript(spell_mage_ice_barrier); RegisterSpellScript(spell_mage_ice_block); RegisterSpellScript(spell_mage_ice_lance); |