Core/Spells: Implement mage talent "Wildfire" (#31248)

Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
Aqua Deus
2025-09-14 20:33:27 +02:00
committed by GitHub
parent 539f0e9983
commit ad1bb2d355
2 changed files with 67 additions and 0 deletions

View File

@@ -110,6 +110,7 @@ enum MageSpells
SPELL_MAGE_CHAIN_REACTION_DUMMY = 278309,
SPELL_MAGE_CHAIN_REACTION = 278310,
SPELL_MAGE_TOUCH_OF_THE_MAGI_EXPLODE = 210833,
SPELL_MAGE_WILDFIRE_TALENT = 383489,
SPELL_MAGE_WINTERS_CHILL = 228358
};
@@ -1842,6 +1843,62 @@ class spell_mage_water_elemental_freeze : public SpellScript
}
};
// 383493 - Wildfire
class spell_mage_wildfire_area_crit : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellEffect({ { SPELL_MAGE_WILDFIRE_TALENT, EFFECT_3 } });
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
Unit* caster = GetCaster();
if (!caster)
return;
AuraEffect const* wildfireCritEffect = caster->GetAuraEffect(SPELL_MAGE_WILDFIRE_TALENT, EFFECT_3);
if (!wildfireCritEffect)
return;
canBeRecalculated = false;
amount = wildfireCritEffect->GetAmount();
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_wildfire_area_crit::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_CRIT_PCT);
}
};
// 383492 - Wildfire
class spell_mage_wildfire_caster_crit : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellEffect({ { SPELL_MAGE_WILDFIRE_TALENT, EFFECT_2 } });
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
{
Unit* caster = GetCaster();
if (!caster)
return;
AuraEffect const* wildfireCritEffect = caster->GetAuraEffect(SPELL_MAGE_WILDFIRE_TALENT, EFFECT_2);
if (!wildfireCritEffect)
return;
canBeRecalculated = false;
amount = wildfireCritEffect->GetAmount();
}
void Register() override
{
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_wildfire_caster_crit::CalculateAmount, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER);
}
};
void AddSC_mage_spell_scripts()
{
RegisterSpellScript(spell_mage_alter_time_aura);
@@ -1902,4 +1959,6 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_tempest_barrier);
RegisterSpellScript(spell_mage_touch_of_the_magi_aura);
RegisterSpellScript(spell_mage_water_elemental_freeze);
RegisterSpellScript(spell_mage_wildfire_area_crit);
RegisterSpellScript(spell_mage_wildfire_caster_crit);
}