Scripts/Spells: Merge spell_mage_wildfire_crit script classes
Port From (https://github.com/TrinityCore/TrinityCore/commit/3a62fefd0a6aeeb8bd15c015be6fc7824a2fc8de)
This commit is contained in:
@@ -1798,12 +1798,14 @@ class spell_mage_water_elemental_freeze : SpellScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Script] // 383493 - Wildfire
|
// 383492 - Wildfire
|
||||||
class spell_mage_wildfire_area_crit : AuraScript
|
[Script("spell_mage_wildfire_area_crit", AuraType.ModCritPct, 3)]
|
||||||
|
[Script("spell_mage_wildfire_caster_crit", AuraType.AddPctModifier, 2)]
|
||||||
|
class spell_mage_wildfire_crit(AuraType auraType, uint effIndex) : AuraScript()
|
||||||
{
|
{
|
||||||
public override bool Validate(SpellInfo spellInfo)
|
public override bool Validate(SpellInfo spellInfo)
|
||||||
{
|
{
|
||||||
return ValidateSpellEffect((SpellIds.WildfireTalent, 3));
|
return ValidateSpellEffect((SpellIds.WildfireTalent, effIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
||||||
@@ -1812,7 +1814,7 @@ class spell_mage_wildfire_area_crit : AuraScript
|
|||||||
if (caster == null)
|
if (caster == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AuraEffect wildfireCritEffect = caster.GetAuraEffect(SpellIds.WildfireTalent, 3);
|
AuraEffect wildfireCritEffect = caster.GetAuraEffect(SpellIds.WildfireTalent, effIndex);
|
||||||
if (wildfireCritEffect == null)
|
if (wildfireCritEffect == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1822,34 +1824,6 @@ class spell_mage_wildfire_area_crit : AuraScript
|
|||||||
|
|
||||||
public override void Register()
|
public override void Register()
|
||||||
{
|
{
|
||||||
DoEffectCalcAmount.Add(new(CalculateAmount, 0, AuraType.ModCritPct));
|
DoEffectCalcAmount.Add(new(CalculateAmount, 0, auraType));
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[Script] // 383492 - Wildfire
|
|
||||||
class spell_mage_wildfire_caster_crit : AuraScript
|
|
||||||
{
|
|
||||||
public override bool Validate(SpellInfo spellInfo)
|
|
||||||
{
|
|
||||||
return ValidateSpellEffect((SpellIds.WildfireTalent, 2));
|
|
||||||
}
|
|
||||||
|
|
||||||
void CalculateAmount(AuraEffect aurEff, ref int amount, ref bool canBeRecalculated)
|
|
||||||
{
|
|
||||||
Unit caster = GetCaster();
|
|
||||||
if (caster == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
AuraEffect wildfireCritEffect = caster.GetAuraEffect(SpellIds.WildfireTalent, 2);
|
|
||||||
if (wildfireCritEffect == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
canBeRecalculated = false;
|
|
||||||
amount = wildfireCritEffect.GetAmount();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Register()
|
|
||||||
{
|
|
||||||
DoEffectCalcAmount.Add(new(CalculateAmount, 0, AuraType.AddPctModifier));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user