diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 074717203..fde1e0ffd 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -324,6 +324,13 @@ namespace Scripts.Spells.Generic public const uint ZealOfTheBurningBlade = 274740; public const uint FerocityOfTheFrostwolf = 274741; public const uint MightOfTheBlackrock = 274742; + + // BloodlustExhaustionSpell + public const uint ShamanSated = 57724; // Bloodlust + public const uint ShamanExhaustion = 57723; // Heroism, Drums + public const uint MageTemporalDisplacement = 80354; + public const uint HunterFatigued = 264689; + public const uint EvokerExhaustion = 390435; } struct CreatureIds @@ -4972,6 +4979,67 @@ namespace Scripts.Spells.Generic } } + // 2825 - Bloodlust + // 32182 - Heroism + // 80353 - Time Warp + // 264667 - Primal Rage + // 390386 - Fury of the Aspects + // 146555 - Drums of Rage + // 178207 - Drums of Fury + // 230935 - Drums of the Mountain + // 256740 - Drums of the Maelstrom + // 309658 - Drums of Deathly Ferocity + // 381301 - Feral Hide Drums + [Script("spell_sha_bloodlust", SpellIds.ShamanSated)] + [Script("spell_sha_heroism", SpellIds.ShamanExhaustion)] + [Script("spell_mage_time_warp", SpellIds.MageTemporalDisplacement)] + [Script("spell_hun_primal_rage", SpellIds.HunterFatigued)] + [Script("spell_evo_fury_of_the_aspects", SpellIds.EvokerExhaustion)] + [Script("spell_item_bloodlust_drums", SpellIds.ShamanExhaustion)] + class spell_gen_bloodlust : SpellScript + { + uint _exhaustionSpellId; + + public spell_gen_bloodlust(uint exhaustionSpellId) + { + _exhaustionSpellId = exhaustionSpellId; + } + + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.ShamanSated, SpellIds.ShamanExhaustion, SpellIds.MageTemporalDisplacement, SpellIds.HunterFatigued, SpellIds.EvokerExhaustion); + } + + void FilterTargets(List targets) + { + targets.RemoveAll(target => + { + Unit unit = target.ToUnit(); + if (unit == null) + return true; + + return unit.HasAura(SpellIds.ShamanSated) + || unit.HasAura(SpellIds.ShamanExhaustion) + || unit.HasAura(SpellIds.MageTemporalDisplacement) + || unit.HasAura(SpellIds.HunterFatigued) + || unit.HasAura(SpellIds.EvokerExhaustion); + }); + } + + void HandleHit(uint effIndex) + { + Unit target = GetHitUnit(); + target.CastSpell(target, _exhaustionSpellId, true); + } + + public override void Register() + { + OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitCasterAreaRaid)); + OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 1, Targets.UnitCasterAreaRaid)); + OnEffectHitTarget.Add(new EffectHandler(HandleHit, 0, SpellEffectName.ApplyAura)); + } + } + // 40307 - Stasis Field class StasisFieldSearcher : ICheck { diff --git a/Source/Scripts/Spells/Mage.cs b/Source/Scripts/Spells/Mage.cs index d7c29bdbb..31395d148 100644 --- a/Source/Scripts/Spells/Mage.cs +++ b/Source/Scripts/Spells/Mage.cs @@ -61,7 +61,6 @@ namespace Scripts.Spells.Mage public const uint SerpentForm = 32817; public const uint SheepForm = 32820; public const uint SquirrelForm = 32813; - public const uint TemporalDisplacement = 80354; public const uint WorgenForm = 32819; public const uint IceLanceTrigger = 228598; public const uint ThermalVoid = 155149; @@ -69,12 +68,6 @@ namespace Scripts.Spells.Mage public const uint ChainReactionDummy = 278309; public const uint ChainReaction = 278310; public const uint TouchOfTheMagiExplode = 210833; - - //Misc - public const uint HunterInsanity = 95809; - public const uint ShamanExhaustion = 57723; - public const uint ShamanSated = 57724; - public const uint PetNetherwindsFatigued = 160455; } // 110909 - Alter Time Aura @@ -1182,36 +1175,6 @@ namespace Scripts.Spells.Mage OnEffectHitTarget.Add(new EffectHandler(HandleDamage, 1, SpellEffectName.SchoolDamage)); } } - - [Script] // 80353 - Time Warp - class spell_mage_time_warp : SpellScript - { - public override bool Validate(SpellInfo spellInfo) - { - return ValidateSpellInfo(SpellIds.TemporalDisplacement, SpellIds.HunterInsanity, SpellIds.ShamanExhaustion, SpellIds.ShamanSated, SpellIds.PetNetherwindsFatigued); - } - - void RemoveInvalidTargets(List targets) - { - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.TemporalDisplacement)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.HunterInsanity)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.ShamanExhaustion)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.ShamanSated)); - } - - void ApplyDebuff() - { - Unit target = GetHitUnit(); - if (target) - target.CastSpell(target, SpellIds.TemporalDisplacement, true); - } - - public override void Register() - { - OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(RemoveInvalidTargets, SpellConst.EffectAll, Targets.UnitCasterAreaRaid)); - AfterHit.Add(new HitHandler(ApplyDebuff)); - } - } [Script] // 210824 - Touch of the Magi (Aura) class spell_mage_touch_of_the_magi_aura : AuraScript diff --git a/Source/Scripts/Spells/Shaman.cs b/Source/Scripts/Spells/Shaman.cs index bf3e0b25d..9f59ef97e 100644 --- a/Source/Scripts/Spells/Shaman.cs +++ b/Source/Scripts/Spells/Shaman.cs @@ -40,7 +40,6 @@ namespace Scripts.Spells.Shaman public const uint ElementalBlastOverload = 120588; public const uint ElementalMastery = 16166; public const uint EnergySurge = 40465; - public const uint Exhaustion = 57723; public const uint FlameShock = 188389; public const uint FlametongueAttack = 10444; public const uint FlametongueWeaponEnchant = 334294; @@ -74,7 +73,6 @@ namespace Scripts.Spells.Shaman public const uint PathOfFlamesSpread = 210621; public const uint PathOfFlamesTalent = 201909; public const uint PowerSurge = 40466; - public const uint Sated = 57724; public const uint SpiritWolfTalent = 260878; public const uint SpiritWolfPeriodic = 260882; public const uint SpiritWolfAura = 260881; @@ -89,11 +87,6 @@ namespace Scripts.Spells.Shaman public const uint WindfuryAttack = 25504; public const uint WindfuryEnchantment = 334302; public const uint WindRush = 192082; - - //Misc - public const uint HunterInsanity = 95809; - public const uint MageTemporalDisplacement = 80354; - public const uint PetNetherwindsFatigued = 160455; } struct CreatureIds @@ -191,36 +184,6 @@ namespace Scripts.Spells.Shaman } } - [Script] // 2825 - Bloodlust - class spell_sha_bloodlust : SpellScript - { - public override bool Validate(SpellInfo spellInfo) - { - return ValidateSpellInfo(SpellIds.Sated, SpellIds.HunterInsanity, SpellIds.MageTemporalDisplacement, SpellIds.PetNetherwindsFatigued); - } - - void RemoveInvalidTargets(List targets) - { - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.Sated)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.HunterInsanity)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.MageTemporalDisplacement)); - } - - void ApplyDebuff() - { - Unit target = GetHitUnit(); - if (target) - target.CastSpell(target, SpellIds.Sated, true); - } - - public override void Register() - { - OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(RemoveInvalidTargets, 0, Targets.UnitCasterAreaRaid)); - OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(RemoveInvalidTargets, 1, Targets.UnitCasterAreaRaid)); - AfterHit.Add(new HitHandler(ApplyDebuff)); - } - } - [Script] // 188443 - Chain Lightning class spell_sha_chain_lightning : SpellScript { @@ -707,36 +670,6 @@ namespace Scripts.Spells.Shaman } } - [Script] // 32182 - Heroism - class spell_sha_heroism : SpellScript - { - public override bool Validate(SpellInfo spellInfo) - { - return ValidateSpellInfo(SpellIds.Exhaustion, SpellIds.HunterInsanity, SpellIds.MageTemporalDisplacement, SpellIds.PetNetherwindsFatigued); - } - - void RemoveInvalidTargets(List targets) - { - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.Exhaustion)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.HunterInsanity)); - targets.RemoveAll(new UnitAuraCheck(true, SpellIds.MageTemporalDisplacement)); - } - - void ApplyDebuff() - { - Unit target = GetHitUnit(); - if (target) - target.CastSpell(target, SpellIds.Exhaustion, true); - } - - public override void Register() - { - OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(RemoveInvalidTargets, 0, Targets.UnitCasterAreaRaid)); - OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(RemoveInvalidTargets, 1, Targets.UnitCasterAreaRaid)); - AfterHit.Add(new HitHandler(ApplyDebuff)); - } - } - [Script] // 210714 - Icefury class spell_sha_icefury : AuraScript {