more updates
This commit is contained in:
1 parent
1bfd6605af
commit
7e454b26ac
15 files changed
+882
-544
No files matched your search
@@ -502,6 +502,44 @@ class spell_pal_lay_on_hands : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pal_righteous_defense : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
|
||||
|
||||
class spell_pal_righteous_defense_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_DONT_REPORT;
|
||||
|
||||
if (Unit* target = GetExplTargetUnit())
|
||||
{
|
||||
if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
}
|
||||
else
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_pal_righteous_defense_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_paladin_spell_scripts()
|
||||
{
|
||||
new spell_pal_ardent_defender();
|
||||
@@ -513,4 +551,5 @@ void AddSC_paladin_spell_scripts()
|
||||
new spell_pal_divine_storm();
|
||||
new spell_pal_divine_storm_dummy();
|
||||
new spell_pal_lay_on_hands();
|
||||
new spell_pal_righteous_defense();
|
||||
}
|
||||
Reference in new issue
Block a user