Core/Spells: Implemented spells causing Forbearance
This commit is contained in:
@@ -1263,29 +1263,6 @@ namespace Game.Spells
|
|||||||
{
|
{
|
||||||
switch (GetSpellInfo().SpellFamilyName)
|
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:
|
case SpellFamilyNames.Mage:
|
||||||
switch (GetId())
|
switch (GetId())
|
||||||
{
|
{
|
||||||
@@ -1339,11 +1316,6 @@ namespace Game.Spells
|
|||||||
if (GetId() == 1784)
|
if (GetId() == 1784)
|
||||||
target.RemoveAurasWithFamily(SpellFamilyNames.Rogue, new FlagArray128(0x0000800, 0, 0), target.GetGUID());
|
target.RemoveAurasWithFamily(SpellFamilyNames.Rogue, new FlagArray128(0x0000800, 0, 0), target.GetGUID());
|
||||||
break;
|
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:
|
case SpellFamilyNames.Hunter:
|
||||||
// Glyph of Freezing Trap
|
// Glyph of Freezing Trap
|
||||||
if (GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00000008u))
|
if (GetSpellInfo().SpellFamilyFlags[0].HasAnyFlag(0x00000008u))
|
||||||
|
|||||||
@@ -2291,20 +2291,6 @@ namespace Game.Spells
|
|||||||
/// @todo move this code to scripts
|
/// @todo move this code to scripts
|
||||||
if (m_preCastSpell != 0)
|
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)
|
if (Global.SpellMgr.GetSpellInfo(m_preCastSpell) != null)
|
||||||
// Blizz seems to just apply aura without bothering to cast
|
// Blizz seems to just apply aura without bothering to cast
|
||||||
m_caster.AddAura(m_preCastSpell, unit);
|
m_caster.AddAura(m_preCastSpell, unit);
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ namespace Scripts.Spells.Paladin
|
|||||||
public const uint EnduringJudgement = 40472;
|
public const uint EnduringJudgement = 40472;
|
||||||
public const uint EyeForAnEyeRank1 = 9799;
|
public const uint EyeForAnEyeRank1 = 9799;
|
||||||
public const uint EyeForAnEyeDamage = 25997;
|
public const uint EyeForAnEyeDamage = 25997;
|
||||||
|
public const uint FinalStand = 204077;
|
||||||
|
public const uint FinalStandEffect = 204079;
|
||||||
public const uint Forbearance = 25771;
|
public const uint Forbearance = 25771;
|
||||||
public const uint HandOfSacrifice = 6940;
|
public const uint HandOfSacrifice = 6940;
|
||||||
public const uint HolyMending = 64891;
|
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
|
[Script] // 115750 - Blinding Light
|
||||||
class spell_pal_blinding_light : SpellScript
|
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
|
[Script] // 190784 - Divine Steed
|
||||||
class spell_pal_divine_steed : SpellScript
|
class spell_pal_divine_steed : SpellScript
|
||||||
{
|
{
|
||||||
@@ -541,28 +617,22 @@ namespace Scripts.Spells.Paladin
|
|||||||
[Script]
|
[Script]
|
||||||
class spell_pal_lay_on_hands : SpellScript
|
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();
|
Unit target = GetExplTargetUnit();
|
||||||
if (target)
|
if (!target || target.HasAura(SpellIds.Forbearance))
|
||||||
{
|
return SpellCastResult.TargetAurastate;
|
||||||
if (caster == target)
|
|
||||||
{
|
|
||||||
if (target.HasAura(SpellIds.Forbearance) || target.HasAura(SpellIds.ImmuneShieldMarker))
|
|
||||||
return SpellCastResult.TargetAurastate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return SpellCastResult.SpellCastOk;
|
return SpellCastResult.SpellCastOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleScript()
|
void TriggerForbearance()
|
||||||
{
|
{
|
||||||
Unit caster = GetCaster();
|
Unit caster = GetCaster();
|
||||||
if (caster == GetHitUnit())
|
if (caster == GetHitUnit())
|
||||||
@@ -574,8 +644,8 @@ namespace Scripts.Spells.Paladin
|
|||||||
|
|
||||||
public override void Register()
|
public override void Register()
|
||||||
{
|
{
|
||||||
OnCheckCast.Add(new CheckCastHandler(CheckCast));
|
OnCheckCast.Add(new CheckCastHandler(CheckForbearance));
|
||||||
AfterHit.Add(new HitHandler(HandleScript));
|
AfterHit.Add(new HitHandler(TriggerForbearance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
-- Quest 25039: Have You Seen Anything Weird Out There?
|
||||||
|
UPDATE `quest_template` SET `RewardNextQuest`=24993 WHERE `ID`=25039;
|
||||||
|
|
||||||
|
-- add ExclusiveGroup 24992 - only one of the quests must be available
|
||||||
|
DELETE FROM `quest_template_addon` WHERE `ID` IN (24992,25039);
|
||||||
|
INSERT INTO `quest_template_addon` (`ID`,`MaxLevel`,`AllowableClasses`,`SourceSpellID`,`PrevQuestID`,`NextQuestID`,`ExclusiveGroup`,`RewardMailTemplateID`,`RewardMailDelay`,`RequiredSkillID`,`RequiredSkillPoints`,`RequiredMinRepFaction`,`RequiredMaxRepFaction`,`RequiredMinRepValue`,`RequiredMaxRepValue`,`ProvidedItemCount`,`SpecialFlags`,`ScriptName`) VALUES
|
||||||
|
(24992, 0, 0, 0, 0, 24993, 24992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ''),
|
||||||
|
(25039, 0, 0, 0, 0, 24993, 24992, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
|
||||||
|
|
||||||
|
-- add missing quest_offer_reward entries for 24992/24993/25039
|
||||||
|
DELETE FROM `quest_offer_reward` WHERE `ID` IN (24992,25039,24993);
|
||||||
|
INSERT INTO `quest_offer_reward` (`ID`,`Emote1`,`Emote2`,`Emote3`,`Emote4`,`EmoteDelay1`,`EmoteDelay2`,`EmoteDelay3`,`EmoteDelay4`,`RewardText`,`VerifiedBuild`) VALUES
|
||||||
|
(24992, 0, 0, 0, 0, 0, 0, 0, 0, 'Hmm... yes, that makes sense. Since the worgen have come streaming out of Gilneas, I knew it would only be a matter of time before they arrived here in Tirisfal.', 0),
|
||||||
|
(25039, 0, 0, 0, 0, 0, 0, 0, 0, 'Hmm... yes, that makes sense. Since the worgen have come streaming out of Gilneas, I knew it would only be a matter of time before they arrived here in Tirisfal.', 0),
|
||||||
|
(24993, 0, 0, 0, 0, 0, 0, 0, 0, "To think, they've been right under our noses! I'll put my deathguards on alert... this will NOT happen again.", 0);
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
DELETE FROM `spell_script_names` WHERE `ScriptName` IN (
|
||||||
|
'spell_pal_blessing_of_protection',
|
||||||
|
'spell_pal_divine_shield');
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(1022, 'spell_pal_blessing_of_protection'),
|
||||||
|
(204018, 'spell_pal_blessing_of_protection'),
|
||||||
|
(642, 'spell_pal_divine_shield');
|
||||||
Reference in New Issue
Block a user