Skip to content

Commit

Permalink
fix(Scripts/Spells): Spell school reflectors should have failure chan… (
Browse files Browse the repository at this point in the history
azerothcore#20560)

fix(Scripts/Spells): Spell school reflectors should have failure chance at higher levels
  • Loading branch information
Nyeriah authored Nov 14, 2024
1 parent 65d2ca3 commit 5252e6c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/sql/updates/pending_db_world/rev_1731586109166584600.sql
Original file line number Diff line number Diff line change
@@ -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');
22 changes: 22 additions & 0 deletions src/server/scripts/Spells/spell_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

0 comments on commit 5252e6c

Please sign in to comment.