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:
1 parent
34fc72cf71
commit
b4d2796e33
5 files changed
+254
-108
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user