Core/Spells: Implemented spells causing Forbearance

This commit is contained in:
hondacrx
2017-12-24 17:17:50 -05:00
parent c7219c7098
commit add72a063b
5 changed files with 107 additions and 57 deletions
-28
View File
@@ -1263,29 +1263,6 @@ namespace Game.Spells
{
switch (GetSpellInfo().SpellFamilyName)
{
case SpellFamilyNames.Generic:
switch (GetId())
{
case 61987: // Avenging Wrath
// Remove the immunity shield marker on Avenging Wrath removal if Forbearance is not present
if (target.HasAura(61988) && !target.HasAura(25771))
target.RemoveAura(61988);
break;
case 72368: // Shared Suffering
case 72369:
if (caster != null)
{
AuraEffect aurEff = GetEffect(0);
if (aurEff != null)
{
int remainingDamage = (int)(aurEff.GetAmount() * (aurEff.GetTotalTicks() - aurEff.GetTickNumber()));
if (remainingDamage > 0)
caster.CastCustomSpell(caster, 72373, 0, remainingDamage, 0, true);
}
}
break;
}
break;
case SpellFamilyNames.Mage:
switch (GetId())
{
@@ -1339,11 +1316,6 @@ namespace Game.Spells
if (GetId() == 1784)
target.RemoveAurasWithFamily(SpellFamilyNames.Rogue, new FlagArray128(0x0000800, 0, 0), target.GetGUID());
break;
case SpellFamilyNames.Paladin:
// Remove the immunity shield marker on Forbearance removal if AW marker is not present
if (GetId() == 25771 && target.HasAura(61988) && !target.HasAura(61987))
target.RemoveAura(61988);
break;
case SpellFamilyNames.Hunter:
// Glyph of Freezing Trap
if (GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00000008u))
-14
View File
@@ -2291,20 +2291,6 @@ namespace Game.Spells
/// @todo move this code to scripts
if (m_preCastSpell != 0)
{
// Paladin immunity shields
if (m_preCastSpell == 61988)
{
// Cast Forbearance
m_caster.CastSpell(unit, 25771, true);
// Cast Avenging Wrath Marker
unit.CastSpell(unit, 61987, true);
}
// Avenging Wrath
if (m_preCastSpell == 61987)
// Cast the serverside immunity shield marker
m_caster.CastSpell(unit, 61988, true);
if (Global.SpellMgr.GetSpellInfo(m_preCastSpell) != null)
// Blizz seems to just apply aura without bothering to cast
m_caster.AddAura(m_preCastSpell, unit);
+85 -15
View File
@@ -47,6 +47,8 @@ namespace Scripts.Spells.Paladin
public const uint EnduringJudgement = 40472;
public const uint EyeForAnEyeRank1 = 9799;
public const uint EyeForAnEyeDamage = 25997;
public const uint FinalStand = 204077;
public const uint FinalStandEffect = 204079;
public const uint Forbearance = 25771;
public const uint HandOfSacrifice = 6940;
public const uint HolyMending = 64891;
@@ -154,6 +156,42 @@ namespace Scripts.Spells.Paladin
}
}
// 1022 - Blessing of Protection
[Script] // 204018 - Blessing of Spellwarding
class spell_pal_blessing_of_protection : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.Forbearance) //, SPELL_PALADIN_IMMUNE_SHIELD_MARKER) // uncomment when we have serverside only spells
&& spellInfo.ExcludeTargetAuraSpell == SpellIds.ImmuneShieldMarker;
}
SpellCastResult CheckForbearance()
{
Unit target = GetExplTargetUnit();
if (!target || target.HasAura(SpellIds.Forbearance))
return SpellCastResult.TargetAurastate;
return SpellCastResult.SpellCastOk;
}
void TriggerForbearance()
{
Unit target = GetHitUnit();
if (target)
{
GetCaster().CastSpell(target, SpellIds.Forbearance, true);
GetCaster().CastSpell(target, SpellIds.ImmuneShieldMarker, true);
}
}
public override void Register()
{
OnCheckCast.Add(new CheckCastHandler(CheckForbearance));
AfterHit.Add(new HitHandler(TriggerForbearance));
}
}
[Script] // 115750 - Blinding Light
class spell_pal_blinding_light : SpellScript
{
@@ -175,6 +213,44 @@ namespace Scripts.Spells.Paladin
}
}
[Script] // 642 - Divine Shield
class spell_pal_divine_shield : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.FinalStand, SpellIds.FinalStandEffect, SpellIds.Forbearance) //, SPELL_PALADIN_IMMUNE_SHIELD_MARKER // uncomment when we have serverside only spells
&& spellInfo.ExcludeCasterAuraSpell == SpellIds.ImmuneShieldMarker;
}
SpellCastResult CheckForbearance()
{
if (GetCaster().HasAura(SpellIds.Forbearance))
return SpellCastResult.TargetAurastate;
return SpellCastResult.SpellCastOk;
}
void HandleFinalStand()
{
if (GetCaster().HasAura(SpellIds.FinalStand))
GetCaster().CastSpell((Unit)null, SpellIds.FinalStandEffect, true);
}
void TriggerForbearance()
{
Unit caster = GetCaster();
caster.CastSpell(caster, SpellIds.Forbearance, true);
caster.CastSpell(caster, SpellIds.ImmuneShieldMarker, true);
}
public override void Register()
{
OnCheckCast.Add(new CheckCastHandler(CheckForbearance));
AfterCast.Add(new CastHandler(HandleFinalStand));
AfterCast.Add(new CastHandler(TriggerForbearance));
}
}
[Script] // 190784 - Divine Steed
class spell_pal_divine_steed : SpellScript
{
@@ -541,28 +617,22 @@ namespace Scripts.Spells.Paladin
[Script]
class spell_pal_lay_on_hands : SpellScript
{
public override bool Validate(SpellInfo spell)
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.Forbearance, SpellIds.ImmuneShieldMarker);
return ValidateSpellInfo(SpellIds.Forbearance)//, SpellIds.ImmuneShieldMarker);
&& spellInfo.ExcludeTargetAuraSpell == SpellIds.ImmuneShieldMarker;
}
SpellCastResult CheckCast()
SpellCastResult CheckForbearance()
{
Unit caster = GetCaster();
Unit target = GetExplTargetUnit();
if (target)
{
if (caster == target)
{
if (target.HasAura(SpellIds.Forbearance) || target.HasAura(SpellIds.ImmuneShieldMarker))
return SpellCastResult.TargetAurastate;
}
}
if (!target || target.HasAura(SpellIds.Forbearance))
return SpellCastResult.TargetAurastate;
return SpellCastResult.SpellCastOk;
}
void HandleScript()
void TriggerForbearance()
{
Unit caster = GetCaster();
if (caster == GetHitUnit())
@@ -574,8 +644,8 @@ namespace Scripts.Spells.Paladin
public override void Register()
{
OnCheckCast.Add(new CheckCastHandler(CheckCast));
AfterHit.Add(new HitHandler(HandleScript));
OnCheckCast.Add(new CheckCastHandler(CheckForbearance));
AfterHit.Add(new HitHandler(TriggerForbearance));
}
}