Core/Script: Implement Paralytic Poison

Closes #16905
This commit is contained in:
ariel-
2016-12-15 10:43:15 -03:00
committed by roc13x
parent d7876762f0
commit 85cfc406dd
2 changed files with 46 additions and 0 deletions

View File

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

View File

@@ -2298,6 +2298,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:
@@ -4130,6 +4172,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_obsidian_armor();
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");