diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index b8117a25c..3757e8a44 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -277,6 +277,12 @@ namespace Scripts.Spells.Generic //CorruptinPlagueEntrys public const uint CorruptingPlague = 40350; + //FreezingCircleMisc + public const uint FreezingCirclePitOfSaronNormal = 69574; + public const uint FreezingCirclePitOfSaronHeroic = 70276; + public const uint FreezingCircle = 34787; + public const uint FreezingCircleScenario = 141383; + //Kazrogalhellfiremark public const uint MarkOfKazrogalHellfire = 189512; public const uint MarkOfKazrogalDamageHellfire = 189515; @@ -401,6 +407,9 @@ namespace Scripts.Spells.Generic { //FungalDecay public const int AuraDuration = 12600; // found in sniffs, there is no duration entry we can possibly use + + //FreezingCircleMisc + public const uint MapIdBloodInTheSnowScenario = 1130; } [Script] @@ -3685,7 +3694,7 @@ namespace Scripts.Spells.Generic Unit _unit; float _distance; } - + [Script] // 40349 - Corrupting Plague class spell_corrupting_plague_aura : AuraScript { @@ -3714,6 +3723,37 @@ namespace Scripts.Spells.Generic OnEffectPeriodic.Add(new EffectPeriodicHandler(OnPeriodic, 0, AuraType.PeriodicTriggerSpell)); } } + + [Script] // 34779 - Freezing Circle + class spell_freezing_circle : SpellScript + { + public override bool Validate(SpellInfo spellInfo) + { + return ValidateSpellInfo(SpellIds.FreezingCirclePitOfSaronNormal, SpellIds.FreezingCirclePitOfSaronHeroic, SpellIds.FreezingCircle, SpellIds.FreezingCircleScenario); + } + + void HandleDamage(uint effIndex) + { + Unit caster = GetCaster(); + uint spellId = 0; + Map map = caster.GetMap(); + + if (map.IsDungeon()) + spellId = map.IsHeroic() ? SpellIds.FreezingCirclePitOfSaronHeroic : SpellIds.FreezingCirclePitOfSaronNormal; + else + spellId = map.GetId() == Misc.MapIdBloodInTheSnowScenario ? SpellIds.FreezingCircleScenario : SpellIds.FreezingCircle; + + SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellId, GetCastDifficulty()); + if (spellInfo != null) + if (!spellInfo.GetEffects().Empty()) + SetHitDamage(spellInfo.GetEffect(0).CalcValue()); + } + + public override void Register() + { + OnEffectHitTarget.Add(new EffectHandler(HandleDamage, 1, SpellEffectName.SchoolDamage)); + } + } [Script] // 169869 - Transformation Sickness class spell_gen_decimatus_transformation_sickness : SpellScript diff --git a/sql/updates/world/master/2021_11_24_08_world_2019_03_02_02_world.sql b/sql/updates/world/master/2021_11_24_08_world_2019_03_02_02_world.sql new file mode 100644 index 000000000..c87f58924 --- /dev/null +++ b/sql/updates/world/master/2021_11_24_08_world_2019_03_02_02_world.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName` ='spell_freezing_circle'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(34779,'spell_freezing_circle');