From 5252e6cf5b155d058c3f3556d276e373d28e4c45 Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:03:35 -0300 Subject: [PATCH] =?UTF-8?q?fix(Scripts/Spells):=20Spell=20school=20reflect?= =?UTF-8?q?ors=20should=20have=20failure=20chan=E2=80=A6=20(#20560)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Scripts/Spells): Spell school reflectors should have failure chance at higher levels --- .../rev_1731586109166584600.sql | 6 +++++ src/server/scripts/Spells/spell_item.cpp | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1731586109166584600.sql diff --git a/data/sql/updates/pending_db_world/rev_1731586109166584600.sql b/data/sql/updates/pending_db_world/rev_1731586109166584600.sql new file mode 100644 index 000000000..f2d832a09 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1731586109166584600.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_item_spell_reflectors'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(23132, 'spell_item_spell_reflectors'), +(23097, 'spell_item_spell_reflectors'), +(23131, 'spell_item_spell_reflectors'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 90d8ceb03..1d033aeee 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -4141,6 +4141,27 @@ class spell_item_luffa : public SpellScript } }; +// 23097 - Fire Reflector +// 23131 - Frost Reflector +// 23132 - Shadow Reflector +class spell_item_spell_reflectors: public AuraScript +{ + PrepareAuraScript(spell_item_spell_reflectors); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (GetCaster()->GetLevel() > 70) + amount = 4; + else if (GetCaster()->GetLevel() > 60) + amount = 50; + } + + void Register() override + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_item_spell_reflectors::CalculateAmount, EFFECT_0, SPELL_AURA_REFLECT_SPELLS_SCHOOL); + } +}; + void AddSC_item_spell_scripts() { RegisterSpellScript(spell_item_massive_seaforium_charge); @@ -4267,4 +4288,5 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_gor_dreks_ointment); RegisterSpellScript(spell_item_skyguard_blasting_charges); RegisterSpellScript(spell_item_luffa); + RegisterSpellScript(spell_item_spell_reflectors); }