Core/Spells: Moved applying exclusive aura spells to scripts

This commit is contained in:
hondacrx
2017-12-24 17:21:05 -05:00
parent add72a063b
commit 7a4d4ad945
3 changed files with 109 additions and 56 deletions
+42
View File
@@ -2542,6 +2542,48 @@ namespace Scripts.Spells.Generic
}
}
[Script]
class spell_gen_trigger_exclude_caster_aura_spell_SpellScript : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(spellInfo.ExcludeCasterAuraSpell);
}
void HandleTrigger()
{
// Blizz seems to just apply aura without bothering to cast
GetCaster().AddAura(GetSpellInfo().ExcludeCasterAuraSpell, GetCaster());
}
public override void Register()
{
AfterCast.Add(new CastHandler(HandleTrigger));
}
}
[Script]
class spell_gen_trigger_exclude_target_aura_spell_SpellScript : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(spellInfo.ExcludeTargetAuraSpell);
}
void HandleTrigger()
{
Unit target = GetHitUnit();
if (target)
// Blizz seems to just apply aura without bothering to cast
GetCaster().AddAura(GetSpellInfo().ExcludeTargetAuraSpell, target);
}
public override void Register()
{
AfterHit.Add(new HitHandler(HandleTrigger));
}
}
[Script("spell_pvp_trinket_shared_cd", SpellIds.WillOfTheForsakenCooldownTrigger)]
[Script("spell_wotf_shared_cd", SpellIds.WillOfTheForsakenCooldownTriggerWotf)]
class spell_pvp_trinket_wotf_shared_cd : SpellScript