From 0512d22bf1dcb2dcff222b96477ebc78832e192a Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 4 Jul 2022 15:20:17 -0400 Subject: [PATCH] Scripts/Spells: Furious Rage & scripts for creatures who uses it Port From (https://github.com/TrinityCore/TrinityCore/commit/9dabdf7724e0555a5935f0073d0b2db7035b23cf) --- Source/Scripts/Spells/Generic.cs | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 5aeb5e687..4d00ee8b9 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -117,6 +117,9 @@ namespace Scripts.Spells.Generic public const uint CreateToken = 50063; public const uint StealEssenceVisual = 50101; + //FuriousRage + public const uint Exhaustion = 35492; + // Fishingspells public const uint FishingNoFishingPole = 131476; public const uint FishingWithPole = 131490; @@ -383,6 +386,13 @@ namespace Scripts.Spells.Generic public const uint SayAmphitheaterVendor = 0; } + struct EmoteIds + { + //FuriousRage + public const uint FuriousRage = 19415; + public const uint Exhausted = 18368; + } + struct AchievementIds { //TournamentAchievements @@ -1931,6 +1941,39 @@ namespace Scripts.Spells.Generic } } + [Script] // 35491 - Furious Rage + class spell_gen_furious_rage : AuraScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.Exhaustion) && + CliDB.BroadcastTextStorage.HasRecord(EmoteIds.FuriousRage) && + CliDB.BroadcastTextStorage.HasRecord(EmoteIds.Exhausted); + } + + void AfterApply(AuraEffect aurEff, AuraEffectHandleModes mode) + { + Unit target = GetTarget(); + target.TextEmote(EmoteIds.FuriousRage, target, false); + } + + void AfterRemove(AuraEffect aurEff, AuraEffectHandleModes mode) + { + if (GetTargetApplication().GetRemoveMode() != AuraRemoveMode.Expire) + return; + + Unit target = GetTarget(); + target.TextEmote(EmoteIds.Exhausted, target, false); + target.CastSpell(target, SpellIds.Exhaustion, true); + } + + public override void Register() + { + AfterEffectApply.Add(new EffectApplyHandler(AfterApply, 0, AuraType.ModDamagePercentDone, AuraEffectHandleModes.Real)); + AfterEffectRemove.Add(new EffectApplyHandler(AfterRemove, 0, AuraType.ModDamagePercentDone, AuraEffectHandleModes.Real)); + } + } + [Script] // 46642 - 5,000 Gold class spell_gen_5000_gold : SpellScript {