From 9cee5e1d617cb002a6e400dd71082edd1fafbc44 Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sat, 23 Jan 2021 16:59:43 +0100 Subject: [PATCH] fix(Core/Spell): Paralytic Poison (#4128) --- .../rev_1609539037767254100.sql | 5 +++ src/server/scripts/Spells/spell_generic.cpp | 43 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1609539037767254100.sql diff --git a/data/sql/updates/pending_db_world/rev_1609539037767254100.sql b/data/sql/updates/pending_db_world/rev_1609539037767254100.sql new file mode 100644 index 000000000..d61992f32 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1609539037767254100.sql @@ -0,0 +1,5 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1609539037767254100'); + +DELETE FROM `spell_script_names` WHERE `spell_id` = 35201 AND `ScriptName`='spell_gen_paralytic_poison'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(35201, 'spell_gen_paralytic_poison'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 1e372721a..0d1e1bb9b 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4243,6 +4243,48 @@ public: } }; +enum ParalyticPoison +{ + SPELL_PARALYSIS = 35202 +}; + +// 35201 - Paralytic Poison +class spell_gen_paralytic_poison : public SpellScriptLoader +{ +public: + spell_gen_paralytic_poison() : SpellScriptLoader("spell_gen_paralytic_poison") { } + + class spell_gen_paralytic_poison_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_paralytic_poison_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return (sSpellMgr->GetSpellInfo(SPELL_PARALYSIS)); + } + + void HandleStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE) + { + return; + } + + GetTarget()->CastSpell((Unit*)nullptr, SPELL_PARALYSIS, true, nullptr, aurEff); + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_paralytic_poison_AuraScript::HandleStun, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gen_paralytic_poison_AuraScript(); + } +}; + // Blade Warding - 64440 enum BladeWarding { @@ -5103,6 +5145,7 @@ void AddSC_generic_spell_scripts() new spell_gen_count_pct_from_max_hp("spell_gen_100pct_count_pct_from_max_hp", 100); new spell_gen_despawn_self(); new spell_gen_bandage(); + new spell_gen_paralytic_poison(); new spell_gen_blade_warding(); new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL); new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);