Skip to content

Instantly share code, notes, and snippets.

@saqirmdev
Last active December 15, 2015 08:49
Show Gist options
  • Save saqirmdev/5233401 to your computer and use it in GitHub Desktop.
Save saqirmdev/5233401 to your computer and use it in GitHub Desktop.
Drain Life 4.3.4
DELETE FROM `spell_script_names` WHERE spell_id IN (689, 89420);
INSERT INTO `spell_script_names` VALUES (689, 'spell_warl_drain_life');
INSERT INTO `spell_script_names` VALUES (89420, 'spell_warl_drain_life');
&&spell_warlock.cpp
SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818,
SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553,
SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106,
SPELL_WARLOCK_SOULSHATTER = 32835,
SPELL_WARLOCK_UNSTABLE_AFFLICTION = 30108,
+ SPELL_WARLOCK_IMPROVED_LIFE_TAP_ICON_ID = 208,
+ SPELL_WARLOCK_DRAIN_LIFE = 89653,
SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117
---
+ class spell_warl_drain_life : public SpellScriptLoader
+{
+ public:
+ spell_warl_drain_life() : SpellScriptLoader("spell_warl_drain_life") {}
+
+ class spell_warl_drain_life_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_drain_life_AuraScript);
+
+ void OnPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ int32 getPctHealth = 2; // 2% Restore
+ // Check for Death's Embrace
+ if (AuraEffect const* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_WARLOCK, 3223, 0))
+ if (GetCaster()->HealthBelowPct(25))
+ getPctHealth += int32(aurEff->GetAmount());
+ GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARLOCK_DRAIN_LIFE, &getPctHealth, NULL, NULL, true);
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_warl_drain_life_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
+ }
+ };
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_drain_life_AuraScript();
+ }
+};
void AddSC_warlock_spell_scripts()
{
new spell_warl_bane_of_doom();
new spell_warl_banish();
new spell_warl_conflagrate();
new spell_warl_create_healthstone();
new spell_warl_demonic_circle_summon();
new spell_warl_demonic_circle_teleport();
new spell_warl_demonic_empowerment();
new spell_warl_demon_soul();
new spell_warl_everlasting_affliction();
new spell_warl_fel_flame();
new spell_warl_fel_synergy();
new spell_warl_haunt();
new spell_warl_health_funnel();
new spell_warl_life_tap();
new spell_warl_ritual_of_doom_effect();
new spell_warl_seed_of_corruption();
new spell_warl_shadow_ward();
new spell_warl_siphon_life();
new spell_warl_soulshatter();
new spell_warl_unstable_affliction();
+ new spell_warl_drain_life();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment