Core/Spells: moved Improved Paladin Auras and Aura Mastery into SpellScripts

Closes #205
Closes #5163
Closes #6809
Closes #7408
Closes #9587
This commit is contained in:
joschiwald
2013-07-27 02:37:48 +02:00
parent 34fc72cf71
commit b4d2796e33
5 changed files with 254 additions and 108 deletions

View File

@@ -0,0 +1,11 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (31821,64364,-20254,-20138,31869,-53379,63510,63514,63531);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(31821, 'spell_pal_aura_mastery'),
(64364, 'spell_pal_aura_mastery_immune'),
(-20254,'spell_pal_improved_concentraction_aura'),
(-20138,'spell_pal_improved_devotion_aura'),
(31869, 'spell_pal_sanctified_retribution'),
(-53379,'spell_pal_swift_retribution'),
(63510, 'spell_pal_improved_concentraction_aura_effect'),
(63514, 'spell_pal_improved_devotion_aura_effect'),
(63531, 'spell_pal_sanctified_retribution_effect');

View File

@@ -1632,36 +1632,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_PALADIN:
switch (GetId())
{
case 19746:
if (!caster)
break;
// Improved concentration aura - linked aura
if (caster->HasAura(20254) || caster->HasAura(20255) || caster->HasAura(20256))
{
if (apply)
target->CastSpell(target, 63510, true);
else
target->RemoveAura(63510);
}
break;
case 31821:
// Aura Mastery Triggered Spell Handler
// If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity
// If remove Concentration Aura -> trigger -> remove Aura Mastery Immunity
// If remove Aura Mastery -> trigger -> remove Aura Mastery Immunity
// Do effects only on aura owner
if (GetCasterGUID() != target->GetGUID())
break;
if (apply)
{
if ((GetSpellInfo()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellInfo()->Id == 19746 && target->HasAura(31821)))
target->CastSpell(target, 64364, true);
}
else
target->RemoveAurasDueToSpell(64364, GetCasterGUID());
break;
case 31842: // Divine Illumination
// Item - Paladin T10 Holy 2P Bonus
if (target->HasAura(70755))
@@ -1673,29 +1643,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
}
break;
}
if (GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA)
{
if (!caster)
break;
// Improved devotion aura
if (caster->HasAura(20140) || caster->HasAura(20138) || caster->HasAura(20139))
{
if (apply)
caster->CastSpell(target, 63514, true);
else
target->RemoveAura(63514);
}
// 63531 - linked aura for both Sanctified Retribution and Swift Retribution talents
// Not allow for Retribution Aura (prevent stacking)
if ((GetSpellInfo()->SpellIconID != 555) && (caster->HasAura(53648) || caster->HasAura(53484) || caster->HasAura(53379) || caster->HasAura(31869)))
{
if (apply)
caster->CastSpell(target, 63531, true);
else
target->RemoveAura(63531);
}
}
break;
case SPELLFAMILY_WARLOCK:
// Drain Soul - If the target is at or below 25% health, Drain Soul causes four times the normal damage

View File

@@ -136,7 +136,7 @@ bool _SpellScript::EffectAuraNameCheck::Check(SpellInfo const* spellEntry, uint8
return true;
if (!spellEntry->Effects[effIndex].ApplyAuraName)
return false;
return (effAurName == SPELL_EFFECT_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
return (effAurName == SPELL_AURA_ANY) || (spellEntry->Effects[effIndex].ApplyAuraName == effAurName);
}
std::string _SpellScript::EffectAuraNameCheck::ToString()

View File

@@ -948,24 +948,8 @@ class spell_dk_presence : public SpellScriptLoader
void Register() OVERRIDE
{
uint32 auraType = 0;
switch (m_scriptSpellId)
{
case SPELL_DK_BLOOD_PRESENCE:
auraType = SPELL_AURA_MOD_DAMAGE_PERCENT_DONE;
break;
case SPELL_DK_FROST_PRESENCE:
auraType = SPELL_AURA_MOD_BASE_RESISTANCE_PCT;
break;
case SPELL_DK_UNHOLY_PRESENCE:
auraType = SPELL_AURA_MOD_MELEE_HASTE;
break;
default:
return;
}
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleEffectApply, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, auraType, AURA_EFFECT_HANDLE_REAL);
AfterEffectApply += AuraEffectApplyFn(spell_dk_presence_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_dk_presence_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
}
};

View File

@@ -63,10 +63,24 @@ enum PaladinSpells
SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742,
SPELL_PALADIN_CONCENTRACTION_AURA = 19746,
SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 = 31869,
SPELL_PALADIN_SWIFT_RETRIBUTION_R1 = 53379,
SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA = 63510,
SPELL_PALADIN_IMPROVED_DEVOTION_AURA = 63514,
SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA = 63531,
SPELL_PALADIN_AURA_MASTERY_IMMUNE = 64364,
SPELL_GENERIC_ARENA_DAMPENING = 74410,
SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411
};
enum PaladinSpellIcons
{
PALADIN_ICON_ID_RETRIBUTION_AURA = 555
};
// 31850 - Ardent Defender
class spell_pal_ardent_defender : public SpellScriptLoader
{
@@ -143,6 +157,80 @@ class spell_pal_ardent_defender : public SpellScriptLoader
}
};
// 31821 - Aura Mastery
class spell_pal_aura_mastery : public SpellScriptLoader
{
public:
spell_pal_aura_mastery() : SpellScriptLoader("spell_pal_aura_mastery") { }
class spell_pal_aura_mastery_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_aura_mastery_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_AURA_MASTERY_IMMUNE))
return false;
return true;
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_AURA_MASTERY_IMMUNE, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveOwnedAura(SPELL_PALADIN_AURA_MASTERY_IMMUNE, GetCasterGUID());
}
void Register() OVERRIDE
{
AfterEffectApply += AuraEffectApplyFn(spell_pal_aura_mastery_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_pal_aura_mastery_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_ADD_PCT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_aura_mastery_AuraScript();
}
};
// 64364 - Aura Mastery Immune
class spell_pal_aura_mastery_immune : public SpellScriptLoader
{
public:
spell_pal_aura_mastery_immune() : SpellScriptLoader("spell_pal_aura_mastery_immune") { }
class spell_pal_aura_mastery_immune_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_aura_mastery_immune_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_CONCENTRACTION_AURA))
return false;
return true;
}
bool CheckAreaTarget(Unit* target)
{
return target->HasAura(SPELL_PALADIN_CONCENTRACTION_AURA, GetCasterGUID());
}
void Register() OVERRIDE
{
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_aura_mastery_immune_AuraScript::CheckAreaTarget);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_aura_mastery_immune_AuraScript();
}
};
// 37877 - Blessing of Faith
class spell_pal_blessing_of_faith : public SpellScriptLoader
{
@@ -589,41 +677,6 @@ class spell_pal_hand_of_salvation : public SpellScriptLoader
}
};
// 37705 - Healing Discount
class spell_pal_item_healing_discount : public SpellScriptLoader
{
public:
spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { }
class spell_pal_item_healing_discount_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_item_healing_discount_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
return false;
return true;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
}
void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_item_healing_discount_AuraScript();
}
};
// -20473 - Holy Shock
class spell_pal_holy_shock : public SpellScriptLoader
{
@@ -696,6 +749,148 @@ class spell_pal_holy_shock : public SpellScriptLoader
}
};
// Maybe this is incorrect
// These spells should always be cast on login, regardless of whether the player has the talent or not
// -20254 - Improved Concentration Aura
// -20138 - Improved Devotion Aura
// 31869 - Sanctified Retribution
// -53379 - Swift Retribution
class spell_pal_improved_aura : public SpellScriptLoader
{
public:
spell_pal_improved_aura(char const* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
class spell_pal_improved_aura_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_improved_aura_AuraScript);
public:
spell_pal_improved_aura_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(_spellId)
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1)
|| !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SWIFT_RETRIBUTION_R1))
return false;
return true;
}
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
if (!target->GetOwnedAura(_spellId))
target->CastSpell(target, _spellId, true);
}
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
uint32 spellId = GetSpellInfo()->GetFirstRankSpell()->Id;
if ((spellId == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SWIFT_RETRIBUTION_R1))
|| (spellId == SPELL_PALADIN_SWIFT_RETRIBUTION_R1 && GetTarget()->GetAuraOfRankedSpell(SPELL_PALADIN_SANCTIFIED_RETRIBUTION_R1)))
return;
GetTarget()->RemoveOwnedAura(_spellId, GetCasterGUID());
}
void Register() OVERRIDE
{
AfterEffectApply += AuraEffectApplyFn(spell_pal_improved_aura_AuraScript::HandleEffectApply, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_pal_improved_aura_AuraScript::HandleEffectRemove, EFFECT_FIRST_FOUND, SPELL_AURA_ADD_FLAT_MODIFIER, AURA_EFFECT_HANDLE_REAL);
}
private:
uint32 _spellId;
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_improved_aura_AuraScript(_spellId);
}
private:
uint32 _spellId;
};
// 63510 - Improved Concentraction Aura (Area Aura)
// 63514 - Improved Devotion Aura (Area Aura)
// 63531 - Sanctified Retribution (Area Aura)
class spell_pal_improved_aura_effect : public SpellScriptLoader
{
public:
spell_pal_improved_aura_effect(char const* name) : SpellScriptLoader(name) { }
class spell_pal_improved_aura_effect_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_improved_aura_effect_AuraScript);
bool CheckAreaTarget(Unit* target)
{
Unit::AuraApplicationMap& appliedAuras = target->GetAppliedAuras();
for (Unit::AuraApplicationMap::iterator itr = appliedAuras.begin(); itr != appliedAuras.end(); ++itr)
{
Aura const* aura = itr->second->GetBase();
if (aura->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_AURA && aura->GetCasterGUID() == GetCasterGUID())
{
// Not allow for Retribution Aura (prevent stacking) - Retribution Aura Overflow and Retribution Aura has same spell effects
if (GetSpellInfo()->Id == SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA && aura->GetSpellInfo()->SpellIconID == PALADIN_ICON_ID_RETRIBUTION_AURA)
return false;
return true;
}
}
return false;
}
void Register() OVERRIDE
{
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_pal_improved_aura_effect_AuraScript::CheckAreaTarget);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_improved_aura_effect_AuraScript();
}
};
// 37705 - Healing Discount
class spell_pal_item_healing_discount : public SpellScriptLoader
{
public:
spell_pal_item_healing_discount() : SpellScriptLoader("spell_pal_item_healing_discount") { }
class spell_pal_item_healing_discount_AuraScript : public AuraScript
{
PrepareAuraScript(spell_pal_item_healing_discount_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_ITEM_HEALING_TRANCE))
return false;
return true;
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_ITEM_HEALING_TRANCE, true, NULL, aurEff);
}
void Register() OVERRIDE
{
OnEffectProc += AuraEffectProcFn(spell_pal_item_healing_discount_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_pal_item_healing_discount_AuraScript();
}
};
// 20425 - Judgement of Command
class spell_pal_judgement_of_command : public SpellScriptLoader
{
@@ -938,6 +1133,8 @@ class spell_pal_seal_of_righteousness : public SpellScriptLoader
void AddSC_paladin_spell_scripts()
{
new spell_pal_ardent_defender();
new spell_pal_aura_mastery();
new spell_pal_aura_mastery_immune();
new spell_pal_blessing_of_faith();
new spell_pal_blessing_of_sanctuary();
new spell_pal_divine_sacrifice();
@@ -948,8 +1145,15 @@ void AddSC_paladin_spell_scripts()
new spell_pal_guarded_by_the_light();
new spell_pal_hand_of_sacrifice();
new spell_pal_hand_of_salvation();
new spell_pal_item_healing_discount();
new spell_pal_holy_shock();
new spell_pal_improved_aura("spell_pal_improved_concentraction_aura", SPELL_PALADIN_IMPROVED_CONCENTRACTION_AURA);
new spell_pal_improved_aura("spell_pal_improved_devotion_aura", SPELL_PALADIN_IMPROVED_DEVOTION_AURA);
new spell_pal_improved_aura("spell_pal_sanctified_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA);
new spell_pal_improved_aura("spell_pal_swift_retribution", SPELL_PALADIN_SANCTIFIED_RETRIBUTION_AURA);
new spell_pal_improved_aura_effect("spell_pal_improved_concentraction_aura_effect");
new spell_pal_improved_aura_effect("spell_pal_improved_devotion_aura_effect");
new spell_pal_improved_aura_effect("spell_pal_sanctified_retribution_effect");
new spell_pal_item_healing_discount();
new spell_pal_judgement_of_command();
new spell_pal_lay_on_hands();
new spell_pal_righteous_defense();