diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-01-02 02:58:19 -0300 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2021-05-06 07:06:27 +0200 |
commit | 87d5544f05a1963ec8bec09056d9bad60b5f697c (patch) | |
tree | 30ff5f30c529ad16bf08a4774f47fbe360894fb6 /src | |
parent | 5ac40cf9d159a74ebb36d06821d4f895afc974c4 (diff) |
Core/Scripts: Implemented Shifting Naaru Sliver
(cherry picked from commit a5d4f34c3158bbbd65436bd2bd1dd8a9fad1ff52)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 654667762af..b430b514fac 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1522,6 +1522,47 @@ class spell_item_piccolo_of_the_flaming_fire : public SpellScript } }; +enum PowerCircle +{ + SPELL_LIMITLESS_POWER = 45044 +}; + +// 45043 - Power Circle (Shifting Naaru Sliver) +class spell_item_power_circle : public AuraScript +{ + PrepareAuraScript(spell_item_power_circle); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_LIMITLESS_POWER }); + } + + bool CheckCaster(Unit* target) + { + return target->GetGUID() == GetCasterGUID(); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->CastSpell(nullptr, SPELL_LIMITLESS_POWER, true); + if (Aura* buff = GetTarget()->GetAura(SPELL_LIMITLESS_POWER)) + buff->SetDuration(GetDuration()); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_LIMITLESS_POWER); + } + + void Register() override + { + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_item_power_circle::CheckCaster); + + AfterEffectApply += AuraEffectApplyFn(spell_item_power_circle::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_item_power_circle::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + // http://www.wowhead.com/item=6657 Savory Deviate Delight // 8213 Savory Deviate Delight enum SavoryDeviateDelight @@ -4120,6 +4161,7 @@ void AddSC_item_spell_scripts() RegisterAuraScript(spell_item_persistent_shield); RegisterAuraScript(spell_item_pet_healing); RegisterSpellScript(spell_item_piccolo_of_the_flaming_fire); + RegisterAuraScript(spell_item_power_circle); RegisterSpellScript(spell_item_savory_deviate_delight); RegisterSpellScript(spell_item_scroll_of_recall); RegisterAuraScript(spell_item_unsated_craving); |