mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Implement mage talent "Wildfire" (#31248)
Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user