diff --git a/data/sql/updates/pending_db_world/rev_1698597123341587200.sql b/data/sql/updates/pending_db_world/rev_1698597123341587200.sql new file mode 100644 index 000000000..dcd14c6dd --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1698597123341587200.sql @@ -0,0 +1,6 @@ +-- Choking Vines +DELETE FROM `spell_custom_attr` WHERE `spell_id`=35244; +INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (35244, 4194304); + +DELETE FROM `spell_script_names` WHERE `spell_id`=35244 AND `ScriptName`='spell_gen_choking_vines'; +INSERT INTO `spell_script_names` VALUES (35244, 'spell_gen_choking_vines'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index bfd937f03..2eb72152b 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5102,6 +5102,40 @@ class spell_gen_yehkinya_bramble : public SpellScript } }; +// 35244 - Choking Vines +enum ChokingVines +{ + SPELL_CHOKING_VINES = 35244, + SPELL_CHOKING_WOUND = 35247 +}; + +class spell_gen_choking_vines : public AuraScript +{ + PrepareAuraScript(spell_gen_choking_vines); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_CHOKING_VINES, SPELL_CHOKING_WOUND }); + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + if (GetStackAmount() == GetSpellInfo()->StackAmount) // 5 stacks + { + target->RemoveAurasDueToSpell(SPELL_CHOKING_VINES); + target->CastSpell(target, SPELL_CHOKING_WOUND, true); // Unknown if it's a self cast or casted by the source on 5th + } + } + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_gen_choking_vines::OnApply, EFFECT_0, SPELL_AURA_MOD_DECREASE_SPEED, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -5254,4 +5288,5 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_planting_scourge_banner); RegisterSpellScript(spell_gen_jubling_cooldown); RegisterSpellScript(spell_gen_yehkinya_bramble); + RegisterSpellScript(spell_gen_choking_vines); }