diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-07-17 20:29:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-17 20:29:08 +0200 |
commit | 1d6aa1455e48edb77d62b763a8932a4dd9f111e5 (patch) | |
tree | 78d0a793e19a60d174a5264b878477f2cb56d637 | |
parent | 836513ba1bd456cba53495354cec132b440d5b81 (diff) |
Scripts/Spells: Implement mage talent Improved Combustion (#31088)
-rw-r--r-- | sql/updates/world/master/2025_07_17_01_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_mage.cpp | 32 |
2 files changed, 35 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_07_17_01_world.sql b/sql/updates/world/master/2025_07_17_01_world.sql new file mode 100644 index 00000000000..5f0b1301642 --- /dev/null +++ b/sql/updates/world/master/2025_07_17_01_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_improved_combustion'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(190319, 'spell_mage_improved_combustion'); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 9027cf6d002..f1f11eee6b0 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -73,6 +73,7 @@ enum MageSpells SPELL_MAGE_ICE_BARRIER = 11426, SPELL_MAGE_ICE_BLOCK = 45438, SPELL_MAGE_IGNITE = 12654, + SPELL_MAGE_IMPROVED_COMBUSTION = 383967, SPELL_MAGE_INCANTERS_FLOW = 116267, SPELL_MAGE_LIVING_BOMB_EXPLOSION = 44461, SPELL_MAGE_LIVING_BOMB_PERIODIC = 217694, @@ -1155,6 +1156,36 @@ class spell_mage_imp_mana_gems : public AuraScript } }; +// 383967 - Improved Combustion (attached to 190319 - Combustion) +class spell_mage_improved_combustion : public AuraScript +{ + bool Load() override + { + return GetUnitOwner()->HasAura(SPELL_MAGE_IMPROVED_COMBUSTION); + } + + void CalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool const& /*canBeRecalculated*/) const + { + if (AuraEffect const* amountHolder = GetEffect(EFFECT_2)) + { + int32 critRating = GetUnitOwner()->ToPlayer()->m_activePlayerData->CombatRatings[CR_CRIT_SPELL]; + amount = CalculatePct(critRating, amountHolder->GetAmount()); + } + } + + void UpdatePeriodic(AuraEffect const* aurEff) const + { + if (AuraEffect* bonus = GetEffect(EFFECT_1)) + bonus->RecalculateAmount(aurEff); + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_improved_combustion::CalcAmount, EFFECT_1, SPELL_AURA_MOD_RATING); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mage_improved_combustion::UpdatePeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY); + } +}; + // 1463 - Incanter's Flow class spell_mage_incanters_flow : public AuraScript { @@ -1757,6 +1788,7 @@ void AddSC_mage_spell_scripts() RegisterSpellScript(spell_mage_ice_lance_damage); RegisterSpellScript(spell_mage_ignite); RegisterSpellScript(spell_mage_imp_mana_gems); + RegisterSpellScript(spell_mage_improved_combustion); RegisterSpellScript(spell_mage_incanters_flow); RegisterSpellScript(spell_mage_living_bomb); RegisterSpellScript(spell_mage_living_bomb_explosion); |