fix(Core/Spells): Script Choking Vines (#17615)

* fix(DB/Custom): Choking Vines should stack from different sources

* script spell

* comment
This commit is contained in:
avarishd
2023-11-02 13:53:45 +02:00
committed by GitHub
parent 9e10d1852e
commit bc688c2a51
2 changed files with 41 additions and 0 deletions

View File

@@ -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');

View File

@@ -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);
}