Scripts/Spells: Implement mage talent Improved Combustion (#31088)

This commit is contained in:
Aqua Deus
2025-07-17 20:29:08 +02:00
committed by GitHub
parent 836513ba1b
commit 1d6aa1455e
2 changed files with 35 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);