Core/Spells: Moved part of improved presences code to spell scripts

This commit is contained in:
tobmaps
2011-07-16 00:46:58 +07:00
parent 99530dcde2
commit f7737f5660
4 changed files with 111 additions and 31 deletions
@@ -1,7 +1,6 @@
-- TODO: this list of vehicles isn't complete, need to find more vehicles with missing immunities -- 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` | UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` |
0x00000002| -- MECHANIC_DISORIENTED (Blind) 0x00000002| -- MECHANIC_DISORIENTED (Blind)
0x00000004| -- MECHANIC_DISARM (Disarm)
0x00000008| -- MECHANIC_DISTRACT (Distract) 0x00000008| -- MECHANIC_DISTRACT (Distract)
0x00000010| -- MECHANIC_FEAR (Fear, Psychic Scream) 0x00000010| -- MECHANIC_FEAR (Fear, Psychic Scream)
0x00000020| -- MECHANIC_GRIP (Death Grip) 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) 0x00002000| -- MECHANIC_KNOUCKOUT (Gouge, Blast Wave)
-- 0x00004000| -- MECHANIC_BLEED (Rend, Deep Wounds) - requires confirmation -- 0x00004000| -- MECHANIC_BLEED (Rend, Deep Wounds) - requires confirmation
0x00010000| -- MECHANIC_POLYMORPH (Polymorph) 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 -- 0x00200000| -- MECHANIC_INFECTED (Frost Fever, Blood Plague) - requires confirmation
0x00800000| -- MECHANIC_HORROR (warlock's Death Coil) 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) 0x02000000| -- MECHANIC_INTERRUPT (Kick, Counterspell)
0x04000000 -- MECHANIC_DAZE (Dazed) 0x04000000 -- MECHANIC_DAZE (Dazed)
where entry IN ( where entry IN (
@@ -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');
@@ -5212,34 +5212,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break; break;
case SPELLFAMILY_DEATHKNIGHT: case SPELLFAMILY_DEATHKNIGHT:
{ {
if (!(mode & AURA_EFFECT_HANDLE_REAL)) //if (!(mode & AURA_EFFECT_HANDLE_REAL))
break; // 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);
}
break; break;
} }
} }
+103
View File
@@ -35,6 +35,10 @@ enum DeathKnightSpells
DK_SPELL_BLOOD_BOIL_TRIGGERED = 65658, DK_SPELL_BLOOD_BOIL_TRIGGERED = 65658,
DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189,
DK_SPELL_WILL_OF_THE_NECROPOLIS_AURA_R1 = 52284, 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) // 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() void AddSC_deathknight_spell_scripts()
{ {
new spell_dk_anti_magic_shell_raid(); new spell_dk_anti_magic_shell_raid();
@@ -566,4 +667,6 @@ void AddSC_deathknight_spell_scripts()
new spell_dk_spell_deflection(); new spell_dk_spell_deflection();
new spell_dk_blood_boil(); new spell_dk_blood_boil();
new spell_dk_will_of_the_necropolis(); new spell_dk_will_of_the_necropolis();
new spell_dk_improved_blood_presence();
new spell_dk_improved_unholy_presence();
} }