mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
fix(Scripts/Paladin): Add cast check to Hand of Protection for casting spell on non-self targets. (#22077)
Hand of Protection no longer can be used if the caster it's stunned or confused.
This commit is contained in:
3
data/sql/updates/pending_db_world/bop-ally.sql
Normal file
3
data/sql/updates/pending_db_world/bop-ally.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` = -1022;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(-1022, 'spell_pal_hand_of_protection');
|
||||
@@ -1150,6 +1150,36 @@ class spell_pal_seal_of_vengeance : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 1022 - Hand of Protection
|
||||
class spell_pal_hand_of_protection : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pal_hand_of_protection);
|
||||
|
||||
SpellCastResult CheckCast()
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster->GetTarget() || caster->GetTarget() == caster->GetGUID())
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
if (caster->HasStunAura())
|
||||
return SPELL_FAILED_STUNNED;
|
||||
|
||||
if (caster->HasConfuseAura())
|
||||
return SPELL_FAILED_CONFUSED;
|
||||
|
||||
if (caster->GetUnitFlags() & UNIT_FLAG_FLEEING)
|
||||
return SPELL_FAILED_FLEEING;
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnCheckCast += SpellCheckCastFn(spell_pal_hand_of_protection::CheckCast);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_paladin_spell_scripts()
|
||||
{
|
||||
RegisterSpellAndAuraScriptPair(spell_pal_seal_of_command, spell_pal_seal_of_command_aura);
|
||||
@@ -1178,4 +1208,5 @@ void AddSC_paladin_spell_scripts()
|
||||
RegisterSpellScript(spell_pal_righteous_defense);
|
||||
RegisterSpellScript(spell_pal_seal_of_righteousness);
|
||||
RegisterSpellScript(spell_pal_seal_of_vengeance);
|
||||
RegisterSpellScript(spell_pal_hand_of_protection);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user