diff options
author | ariel- <ariel-@users.noreply.github.com> | 2016-12-15 10:43:15 -0300 |
---|---|---|
committer | DoctorKraft <DoctorKraft@users.noreply.github.com> | 2018-03-12 16:39:43 +0100 |
commit | 5563f57ce6d7619f986c4880bea4650b6c917bbf (patch) | |
tree | 57db4e97eaf69b04159f13edeffa1458abdadc48 | |
parent | b80600f88adeccaa344a0a997bf95251c3024429 (diff) |
Core/Script: Implement Paralytic Poison
Closes #16905
(cherry picked from commit 4e3ce0463c46540a25c02a503c3bf0064601df96)
-rw-r--r-- | sql/updates/world/master/2018_03_12_10_world_2016_12_15_00_world.sql | 3 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 41 |
2 files changed, 44 insertions, 0 deletions
diff --git a/sql/updates/world/master/2018_03_12_10_world_2016_12_15_00_world.sql b/sql/updates/world/master/2018_03_12_10_world_2016_12_15_00_world.sql new file mode 100644 index 00000000000..5b749f075a3 --- /dev/null +++ b/sql/updates/world/master/2018_03_12_10_world_2016_12_15_00_world.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `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 c046c97d023..5b59f638915 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2530,6 +2530,46 @@ 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 + { + return ValidateSpellInfo({ 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(); + } +}; + class spell_gen_proc_below_pct_damaged : public SpellScriptLoader { public: @@ -4666,6 +4706,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"); |