Scripts/Warlock: Implemented Burning Rush

Port From (https://github.com/TrinityCore/TrinityCore/commit/9ad227f0756aa91f9b772ecf13b40c1f38863e68)
This commit is contained in:
hondacrx
2023-08-21 08:00:12 -04:00
parent 3f07cd5714
commit e7af2898f2
2 changed files with 50 additions and 0 deletions
+44
View File
@@ -76,6 +76,50 @@ namespace Scripts.Spells.Warlock
}
}
[Script] // 111400 - Burning Rush
class spell_warl_burning_rush : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellEffect((spellInfo.Id, 1));
}
SpellCastResult CheckApplyAura()
{
Unit caster = GetCaster();
if (caster.GetHealthPct() <= GetEffectInfo(1).CalcValue(caster))
{
SetCustomCastResultMessage(SpellCustomErrors.YouDontHaveEnoughHealth);
return SpellCastResult.CustomError;
}
return SpellCastResult.SpellCastOk;
}
public override void Register()
{
OnCheckCast.Add(new CheckCastHandler(CheckApplyAura));
}
}
[Script] // 111400 - Burning Rush
class spell_warl_burning_rush_aura : AuraScript
{
void PeriodicTick(AuraEffect aurEff)
{
if (GetTarget().GetHealthPct() <= aurEff.GetAmount())
{
PreventDefaultAction();
Remove();
}
}
public override void Register()
{
OnEffectPeriodic.Add(new EffectPeriodicHandler(PeriodicTick, 1, AuraType.PeriodicDamagePercent));
}
}
[Script] // 116858 - Chaos Bolt
class spell_warl_chaos_bolt : SpellScript
{