diff --git a/sql/updates/world/4.3.4/2023_09_20_00_world.sql b/sql/updates/world/4.3.4/2023_09_20_00_world.sql new file mode 100644 index 0000000000..6fe1902bfa --- /dev/null +++ b/sql/updates/world/4.3.4/2023_09_20_00_world.sql @@ -0,0 +1,9 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_item_nokaled_the_elements_of_death_lfr', +'spell_item_nokaled_the_elements_of_death_normal', +'spell_item_nokaled_the_elements_of_death_heroic'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(109866, 'spell_item_nokaled_the_elements_of_death_lfr'), +(107786, 'spell_item_nokaled_the_elements_of_death_normal'), +(109873, 'spell_item_nokaled_the_elements_of_death_heroic'); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index d2a546c698..01a0c3fc7c 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -5141,6 +5141,39 @@ class spell_item_obsidian_armor : public AuraScript } }; +static constexpr std::array const NoKaledProcSpellIdsLFR = { 109867, 109869, 109871 }; +static constexpr std::array const NoKaledProcSpellIdsNormal = { 107787, 107789, 107785 }; +static constexpr std::array const NoKaledProcSpellIdsHeroic = { 109868, 109870, 109872 }; + +// 109866, 107786, 109873 - Item - Dragon Soul - Proc - Agi Melee 1H Axe LFR +class spell_item_dragon_soul_proc_agi_melee_1h_axe : public AuraScript +{ +public: + spell_item_dragon_soul_proc_agi_melee_1h_axe(std::array const& procSpellIds) : AuraScript(), _procSpellIds(procSpellIds) { } + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo(_procSpellIds); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId = Trinity::Containers::SelectRandomContainerElement(_procSpellIds); + GetTarget()->CastSpell(eventInfo.GetProcTarget(), spellId, aurEff); + + } + + void Register() override + { + OnEffectProc.Register(&spell_item_dragon_soul_proc_agi_melee_1h_axe::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + +private: + std::array _procSpellIds; +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -5278,4 +5311,7 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_satisfied); RegisterSpellScript(spell_item_blaze_of_life); RegisterSpellScript(spell_item_obsidian_armor); + RegisterSpellScriptWithArgs(spell_item_dragon_soul_proc_agi_melee_1h_axe, "spell_item_nokaled_the_elements_of_death_lfr", NoKaledProcSpellIdsLFR); + RegisterSpellScriptWithArgs(spell_item_dragon_soul_proc_agi_melee_1h_axe, "spell_item_nokaled_the_elements_of_death_normal", NoKaledProcSpellIdsNormal); + RegisterSpellScriptWithArgs(spell_item_dragon_soul_proc_agi_melee_1h_axe, "spell_item_nokaled_the_elements_of_death_heroic", NoKaledProcSpellIdsHeroic); }