fixup! spells

This commit is contained in:
Jelle Meeus
2025-07-13 23:51:45 +02:00
parent d548175848
commit 46cee72ece

View File

@@ -250,41 +250,22 @@ class spell_sapphiron_icebolt_40 : public SpellScript
};
// 28531 - Frost Aura
enum FrostAura
{
SPELL_FROST_AURA = 28531,
};
class spell_sapphiron_frost_aura_40 : public AuraScript
{
PrepareAuraScript(spell_sapphiron_frost_aura_40);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_FROST_AURA });
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
if (!caster || (caster->GetMap()->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC))
return;
int32 bp0 = 600;
caster->CastCustomSpell(caster, SPELL_FROST_AURA, &bp0, nullptr, nullptr, false, nullptr, nullptr, GetCasterGUID());
}
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
{
Unit* caster = GetCaster();
if (!caster || (caster->GetMap()->GetDifficulty() != RAID_DIFFICULTY_10MAN_HEROIC))
return;
if (urand(0, 99) == 0) // 1% chance to receive extra Frost Aura tick
amount *= 2;
return;
amount *= 0.5; // Reduce damage by 50% (1200bp -> 600bp)
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_sapphiron_frost_aura_40::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sapphiron_frost_aura_40::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};