diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-12-15 10:43:15 -0300 |
---|---|---|
committer | ariel- <ariel-@users.noreply.github.com> | 2016-12-15 10:43:15 -0300 |
commit | 4e3ce0463c46540a25c02a503c3bf0064601df96 (patch) | |
tree | a8d71ee88319f7d509a4550e93591d0e5d7ee6bf /src | |
parent | 452ef146f41a9bf06ca2bfb8dc9f26ca20b4fb83 (diff) |
Core/Script: Implement Paralytic Poison
Closes #16905
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index ed80247597d..6c534b8f1e5 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2728,6 +2728,48 @@ class spell_gen_orc_disguise : public SpellScriptLoader } }; +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 + { + if (!sSpellMgr->GetSpellInfo(SPELL_PARALYSIS)) + return false; + return true; + } + + 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(); + } +}; + class spell_gen_proc_below_pct_damaged : public SpellScriptLoader { public: @@ -4410,6 +4452,7 @@ void AddSC_generic_spell_scripts() new spell_gen_on_tournament_mount(); new spell_gen_oracle_wolvar_reputation(); new spell_gen_orc_disguise(); + new spell_gen_paralytic_poison(); new spell_gen_proc_below_pct_damaged("spell_item_soul_harvesters_charm"); new spell_gen_proc_below_pct_damaged("spell_item_commendation_of_kaelthas"); new spell_gen_proc_below_pct_damaged("spell_item_corpse_tongue_coin"); |