From 85fe41f0f201842ebc8180cc8d574a4c118274eb Mon Sep 17 00:00:00 2001 From: Aokromes Date: Wed, 3 Jan 2018 04:16:05 +0100 Subject: [PATCH] Core/Scripts: Implemented Shifting Naaru Sliver --- .../world/3.3.5/2018_01_02_03_world.sql | 3 ++ src/server/scripts/Spells/spell_item.cpp | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 sql/updates/world/3.3.5/2018_01_02_03_world.sql diff --git a/sql/updates/world/3.3.5/2018_01_02_03_world.sql b/sql/updates/world/3.3.5/2018_01_02_03_world.sql new file mode 100644 index 00000000000..7110f22eaf0 --- /dev/null +++ b/sql/updates/world/3.3.5/2018_01_02_03_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_power_circle'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(45043, 'spell_item_power_circle'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 5b6ac5955aa..02511885d6b 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1803,6 +1803,47 @@ class spell_item_piccolo_of_the_flaming_fire : public SpellScriptLoader } }; +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 @@ -4740,6 +4781,7 @@ void AddSC_item_spell_scripts() new spell_item_persistent_shield(); new spell_item_pet_healing(); new spell_item_piccolo_of_the_flaming_fire(); + RegisterAuraScript(spell_item_power_circle); new spell_item_savory_deviate_delight(); new spell_item_scroll_of_recall(); new spell_item_unsated_craving();