From 286feb69401126e2835a21f4e43952f298eb84b5 Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 7 Sep 2012 18:01:02 +0100 Subject: Scripts/ToTC: Correcting Jaraxxus Volcano and Nether Portal behaviour Closes #7687 Closes #7467 --- .../CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index 10f7150351e..ea51f07dbe3 100755 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -329,6 +329,8 @@ public: // used to despawn corpse immediately me->DespawnOrUnsummon(); } + + void UpdateAI(uint32 const diff) {} }; }; @@ -438,6 +440,8 @@ public: // used to despawn corpse immediately me->DespawnOrUnsummon(); } + + void UpdateAI(uint32 const diff) {} }; }; -- cgit v1.2.3 From 673ce30f38e983ac73fa916b8a6b1d71790c107c Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 7 Sep 2012 18:26:14 -0500 Subject: Core/Spells: Fixed Improved Health Funnel damage reduction effect. Author: Josh closes #7275 --- .../2012_09_07_02_world_spell_script_names.sql | 3 ++ src/server/scripts/Spells/spell_warlock.cpp | 47 ++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 sql/updates/world/2012_09_07_02_world_spell_script_names.sql (limited to 'src/server/scripts') diff --git a/sql/updates/world/2012_09_07_02_world_spell_script_names.sql b/sql/updates/world/2012_09_07_02_world_spell_script_names.sql new file mode 100644 index 00000000000..652d45543e3 --- /dev/null +++ b/sql/updates/world/2012_09_07_02_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM spell_script_names WHERE spell_id = -755; +INSERT IGNORE INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-755, 'spell_warl_health_funnel'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index e0131190916..9b227737e0a 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -41,6 +41,10 @@ enum WarlockSpells WARLOCK_HAUNT_HEAL = 48210, WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117, WARLOCK_CURSE_OF_DOOM_EFFECT = 18662, + WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, + WARLOCK_IMPROVED_HEALTH_FUNNEL_R2 = 18704, + WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, + WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2 = 60956, }; class spell_warl_banish : public SpellScriptLoader @@ -671,6 +675,48 @@ class spell_warl_curse_of_doom : public SpellScriptLoader } }; +class spell_warl_health_funnel : public SpellScriptLoader +{ +public: + spell_warl_health_funnel() : SpellScriptLoader("spell_warl_health_funnel") { } + + class spell_warl_health_funnel_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_health_funnel_AuraScript) + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); + else if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); + } + + } + + void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* target = GetTarget()) + { + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); + } + } + + void Register() + { + OnEffectRemove += AuraEffectRemoveFn(spell_warl_health_funnel_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + OnEffectApply += AuraEffectApplyFn(spell_warl_health_funnel_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_health_funnel_AuraScript(); + } +}; + void AddSC_warlock_spell_scripts() { new spell_warl_banish(); @@ -686,4 +732,5 @@ void AddSC_warlock_spell_scripts() new spell_warl_haunt(); new spell_warl_unstable_affliction(); new spell_warl_curse_of_doom(); + new spell_warl_health_funnel(); } -- cgit v1.2.3 From 7121f015ed6561a4bc12cf08d8f9286b113e66ad Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 7 Sep 2012 18:31:19 -0500 Subject: Core/Scripts: Fixed a copy/paste mistake from previous commit --- src/server/scripts/Spells/spell_warlock.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/server/scripts') diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 9b227737e0a..a48661d4aed 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -683,25 +683,25 @@ public: class spell_warl_health_funnel_AuraScript : public AuraScript { PrepareAuraScript(spell_warl_health_funnel_AuraScript) + void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetTarget()) - { - if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); - else if (GetCaster()->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) - target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); - } - + Unit* caster = GetCaster(); + if (!caster) + return; + + Unit* target = GetTarget(); + if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R2)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2, true); + else if (caster->HasAura(WARLOCK_IMPROVED_HEALTH_FUNNEL_R1)) + target->CastSpell(target, WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1, true); } void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetTarget()) - { - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); - target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); - } + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1); + target->RemoveAurasDueToSpell(WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R2); } void Register() -- cgit v1.2.3