diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2023-07-13 13:50:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 13:50:50 +0200 |
commit | 9ad227f0756aa91f9b772ecf13b40c1f38863e68 (patch) | |
tree | edca7df61dcbd80c8ee9ecc7116be20fda7ca2be /src | |
parent | 4aaf82539c1c8222f31de8f1185b7daad7e82fb6 (diff) |
Scripts/Warlock: Implemented Burning Rush (#29117)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_warlock.cpp | 56 |
2 files changed, 62 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 367044a66c3..dceb3ad1ed5 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -4717,6 +4717,12 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->AttributesEx &= ~SPELL_ATTR1_IS_CHANNELLED; }); + // Burning Rush + ApplySpellFix({ 111400 }, [](SpellInfo* spellInfo) + { + spellInfo->AttributesEx4 |= SPELL_ATTR4_AURA_IS_BUFF; + }); + for (SpellInfo const& s : mSpellInfoMap) { SpellInfo* spellInfo = &const_cast<SpellInfo&>(s); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 63178261bf3..9258d33ed02 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -106,6 +106,61 @@ private: } }; +// 111400 - Burning Rush +class spell_warl_burning_rush : public SpellScript +{ + PrepareSpellScript(spell_warl_burning_rush); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } }); + } + + SpellCastResult CheckApplyAura() + { + Unit* caster = GetCaster(); + + if (caster->HasAura(GetSpellInfo()->Id)) + { + caster->RemoveAura(GetSpellInfo()->Id); + return SPELL_FAILED_DONT_REPORT; + } + + if (caster->GetHealthPct() <= float(GetEffectInfo(EFFECT_1).CalcValue(caster))) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_YOU_DONT_HAVE_ENOUGH_HEALTH); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_warl_burning_rush::CheckApplyAura); + } +}; + +// 111400 - Burning Rush +class spell_warl_burning_rush_aura : public AuraScript +{ + PrepareAuraScript(spell_warl_burning_rush_aura); + + void PeriodicTick(AuraEffect const* aurEff) + { + if (GetTarget()->GetHealthPct() <= float(aurEff->GetAmount())) + { + PreventDefaultAction(); + Remove(); + } + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_burning_rush_aura::PeriodicTick, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE_PERCENT); + } +}; + // 116858 - Chaos Bolt class spell_warl_chaos_bolt : public SpellScript { @@ -1023,6 +1078,7 @@ class spell_warl_rain_of_fire : public AuraScript void AddSC_warlock_spell_scripts() { RegisterSpellScript(spell_warl_banish); + RegisterSpellAndAuraScriptPair(spell_warl_burning_rush, spell_warl_burning_rush_aura); RegisterSpellScript(spell_warl_chaos_bolt); RegisterSpellScript(spell_warl_chaotic_energies); RegisterSpellScript(spell_warl_create_healthstone); |