diff options
author | tobmaps <spambot42@yandex.ru> | 2011-07-16 00:46:58 +0700 |
---|---|---|
committer | tobmaps <spambot42@yandex.ru> | 2011-07-16 00:46:58 +0700 |
commit | f7737f56604259af83cb836ab61b5bc13211231f (patch) | |
tree | a8717a285032a92f8acd3feb8b4e54350d103565 | |
parent | 99530dcde269cbc36e896447803913a8a81da6bf (diff) |
Core/Spells: Moved part of improved presences code to spell scripts
4 files changed, 111 insertions, 31 deletions
diff --git a/sql/updates/world/2011_07_15_03_world_creature_template.sql b/sql/updates/world/2011_07_15_03_world_creature_template.sql index 353dab27424..610cc916cfd 100644 --- a/sql/updates/world/2011_07_15_03_world_creature_template.sql +++ b/sql/updates/world/2011_07_15_03_world_creature_template.sql @@ -1,7 +1,6 @@ -- TODO: this list of vehicles isn't complete, need to find more vehicles with missing immunities UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` | 0x00000002| -- MECHANIC_DISORIENTED (Blind) -0x00000004| -- MECHANIC_DISARM (Disarm) 0x00000008| -- MECHANIC_DISTRACT (Distract) 0x00000010| -- MECHANIC_FEAR (Fear, Psychic Scream) 0x00000020| -- MECHANIC_GRIP (Death Grip) @@ -14,10 +13,10 @@ UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` | 0x00002000| -- MECHANIC_KNOUCKOUT (Gouge, Blast Wave) -- 0x00004000| -- MECHANIC_BLEED (Rend, Deep Wounds) - requires confirmation 0x00010000| -- MECHANIC_POLYMORPH (Polymorph) -0x00040000| -- MECHANIC_SHIELD (Power word: Shield) +0x00040000| -- MECHANIC_SHIELD (Power word: Shield) -- maybe unnecessary, spells shouldn't be even casted on vehicles -- 0x00200000| -- MECHANIC_INFECTED (Frost Fever, Blood Plague) - requires confirmation 0x00800000| -- MECHANIC_HORROR (warlock's Death Coil) -0x10000000| -- MECHANIC_IMMUNE_SHIELD (Hand of Protection) +0x10000000| -- MECHANIC_IMMUNE_SHIELD (Hand of Protection) -- maybe unnecessary, spells shouldn't be even casted on vehicles 0x02000000| -- MECHANIC_INTERRUPT (Kick, Counterspell) 0x04000000 -- MECHANIC_DAZE (Dazed) where entry IN ( diff --git a/sql/updates/world/2011_07_15_04_world_spell_script_names.sql b/sql/updates/world/2011_07_15_04_world_spell_script_names.sql new file mode 100644 index 00000000000..7fa8011ded5 --- /dev/null +++ b/sql/updates/world/2011_07_15_04_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (50365,50391); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(50365,'spell_dk_improved_blood_presence'), +(50391,'spell_dk_improved_unholy_presence'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a59ce6e7f32..9c8356bf7b3 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -5212,34 +5212,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool break; case SPELLFAMILY_DEATHKNIGHT: { - if (!(mode & AURA_EFFECT_HANDLE_REAL)) - break; - // Improved Unholy Presence - if (m_spellProto->SpellIconID == 2633) - { - if (apply) - { - if (target->HasAura(48265) && !target->HasAura(63622)) - { - // Not listed as any effect, only base points set - int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), 1); - target->CastCustomSpell(target, 63622, &basePoints0 , &basePoints0, &basePoints0, true, 0, this); - } - } - else - target->RemoveAurasDueToSpell(63622); - } - // Improved Blood Presence - else if (m_spellProto->SpellIconID == 2636) - { - if (apply) - { - if (!target->HasAura(48266) && !target->HasAura(63611)) - target->CastSpell(target, 63611, true, NULL, this); - } - else - target->RemoveAurasDueToSpell(63611); - } + //if (!(mode & AURA_EFFECT_HANDLE_REAL)) + // break; break; } } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index ab3cf7e04a3..8ae4a6dbf9c 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -35,6 +35,10 @@ enum DeathKnightSpells DK_SPELL_BLOOD_BOIL_TRIGGERED = 65658, DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, + DK_SPELL_BLOOD_PRESENCE = 48266, + DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED = 63611, + DK_SPELL_UNHOLY_PRESENCE = 48265, + DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED = 63622, }; // 50462 - Anti-Magic Shell (on raid member) @@ -553,6 +557,103 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader } }; +// 50365, 50371 Improved Blood Presence +class spell_dk_improved_blood_presence : public SpellScriptLoader +{ +public: + spell_dk_improved_blood_presence() : SpellScriptLoader("spell_dk_improved_blood_presence") { } + + class spell_dk_improved_blood_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_improved_blood_presence_AuraScript) + bool Validate(SpellEntry const* /*entry*/) + { + if (!sSpellStore.LookupEntry(DK_SPELL_BLOOD_PRESENCE)) + return false; + if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) + { + int32 basePoints1 = aurEff->GetAmount(); + target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, aurEff); + } + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target->HasAura(DK_SPELL_BLOOD_PRESENCE)) + target->RemoveAura(DK_SPELL_IMPROVED_BLOOD_PRESENCE_TRIGGERED); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_blood_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript *GetAuraScript() const + { + return new spell_dk_improved_blood_presence_AuraScript(); + } +}; + +// 50391,50392 Improved Unholy Presence +class spell_dk_improved_unholy_presence : public SpellScriptLoader +{ +public: + spell_dk_improved_unholy_presence() : SpellScriptLoader("spell_dk_improved_unholy_presence") { } + + class spell_dk_improved_unholy_presence_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_improved_unholy_presence_AuraScript) + bool Validate(SpellEntry const* /*entry*/) + { + if (!sSpellStore.LookupEntry(DK_SPELL_UNHOLY_PRESENCE)) + return false; + if (!sSpellStore.LookupEntry(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + return false; + return true; + } + + void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE) && !target->HasAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED)) + { + // Not listed as any effect, only base points set in dbc + int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(aurEff->GetSpellProto(), 1); + target->CastCustomSpell(target, DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED, &basePoints0 , &basePoints0, &basePoints0, true, 0, aurEff); + } + } + + void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->HasAura(DK_SPELL_UNHOLY_PRESENCE)) + target->RemoveAura(DK_SPELL_IMPROVED_UNHOLY_PRESENCE_TRIGGERED); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_dk_improved_unholy_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript *GetAuraScript() const + { + return new spell_dk_improved_unholy_presence_AuraScript(); + } +}; + void AddSC_deathknight_spell_scripts() { new spell_dk_anti_magic_shell_raid(); @@ -566,4 +667,6 @@ void AddSC_deathknight_spell_scripts() new spell_dk_spell_deflection(); new spell_dk_blood_boil(); new spell_dk_will_of_the_necropolis(); + new spell_dk_improved_blood_presence(); + new spell_dk_improved_unholy_presence(); } |